コード例 #1
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
// module basics
define('SOURCE_MODULE', 'source');
define('SOURCE_MODULE_PATH', APPLICATION_PATH . '/modules/source');
// how many logs to get per async update request
if (!defined(SOURCE_MODULE_LOGS_PER_REQUEST)) {
    define('SOURCE_MODULE_LOGS_PER_REQUEST', 20);
}
// if
// load modules
require_once SOURCE_MODULE_PATH . '/models/commits/Commit.class.php';
require_once SOURCE_MODULE_PATH . '/models/commits/Commits.class.php';
require_once SOURCE_MODULE_PATH . '/models/repositories/Repository.class.php';
require_once SOURCE_MODULE_PATH . '/models/repositories/Repositories.class.php';
use_model('commit_project_objects', SOURCE_MODULE);
use_model('source_users', SOURCE_MODULE);
set_for_autoload(array('RepositoryCreatedActivityLog' => SOURCE_MODULE_PATH . '/models/activity_logs/RepositoryCreatedActivityLog.class.php', 'RepositoryUpdateActivityLog' => SOURCE_MODULE_PATH . '/models/activity_logs/RepositoryUpdateActivityLog.class.php'));
define('REPOSITORY_UPDATE_FREQUENTLY', 1);
define('REPOSITORY_UPDATE_HOURLY', 2);
define('REPOSITORY_UPDATE_DAILY', 3);
// define('REPOSITORY_UPDATE_HOOK', 4);
/**
 * List of update types
 *
 * @param null
 * @return array
 */
function source_module_update_types()
{
    return array(REPOSITORY_UPDATE_FREQUENTLY => lang('Frequently'), REPOSITORY_UPDATE_HOURLY => lang('Hourly'), REPOSITORY_UPDATE_DAILY => lang('Daily'));
}
// source module update types
コード例 #2
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
<?php

/**
 * Init discussions module
 *
 * @package activeCollab.modules.discussions
 */
define('DISCUSSIONS_MODULE', 'discussions');
define('DISCUSSIONS_MODULE_PATH', APPLICATION_PATH . '/modules/discussions');
set_for_autoload(array('Discussion' => DISCUSSIONS_MODULE_PATH . '/models/discussions/Discussion.class.php', 'Discussions' => DISCUSSIONS_MODULE_PATH . '/models/discussions/Discussions.class.php', 'DiscussionPinnedActivityLog' => DISCUSSIONS_MODULE_PATH . '/models/activity_logs/DiscussionPinnedActivityLog.class.php', 'DiscussionUnpinnedActivityLog' => DISCUSSIONS_MODULE_PATH . '/models/activity_logs/DiscussionUnpinnedActivityLog.class.php'));
/**
 * Return section URL
 *
 * @param Project $project
 * @return string
 */
function discussions_module_url($project)
{
    return assemble_url('project_discussions', array('project_id' => $project->getId()));
}
// discussions_module_url
/**
 * Return add discussion URL
 *
 * @param Project $project
 * @param array $additional_params
 * @return string
 */
function discussions_module_add_discussion_url($project, $additional_params = null)
{
    $params = array('project_id' => $project->getId());
コード例 #3
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
<?php

/**
 * Calendar module initialization file
 * 
 * @package activeCollab.modules.calendar
 */
define('CALENDAR_MODULE', 'calendar');
define('CALENDAR_MODULE_PATH', APPLICATION_PATH . '/modules/calendar');
set_for_autoload('Calendar', CALENDAR_MODULE_PATH . '/models/Calendar.class.php');
/**
 * Returns true if $user can see $profile calendar
 *
 * @param User $user
 * @param User $profile
 * @return boolean
 */
function can_access_profile_calendar($user, $profile)
{
    return $user->isProjectManager();
}
// can_access_profile_calendar
コード例 #4
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
<?php

/**
 * Init tickets module
 *
 * @package activeCollab.modules.tickets
 */
define('TICKETS_MODULE', 'tickets');
define('TICKETS_MODULE_PATH', APPLICATION_PATH . '/modules/tickets');
set_for_autoload(array('Ticket' => TICKETS_MODULE_PATH . '/models/tickets/Ticket.class.php', 'Tickets' => TICKETS_MODULE_PATH . '/models/tickets/Tickets.class.php', 'TicketChange' => TICKETS_MODULE_PATH . '/models/ticket_changes/TicketChange.class.php', 'TicketChanges' => TICKETS_MODULE_PATH . '/models/ticket_changes/TicketChanges.class.php'));
/**
 * Return section URL
 *
 * @param Project $project
 * @return string
 */
function tickets_module_url($project)
{
    return assemble_url('project_tickets', array('project_id' => $project->getId()));
}
// tickets_module_url
/**
 * Return add ticket URL
 *
 * @param Project $project
 * @param array $additional_params
 * @return string
 */
function tickets_module_add_ticket_url($project, $additional_params = null)
{
    $params = array('project_id' => $project->getId());
コード例 #5
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
 */
define('TIMETRACKING_MODULE', 'timetracking');
define('TIMETRACKING_MODULE_PATH', APPLICATION_PATH . '/modules/timetracking');
define('BILLABLE_FILTER_ALL', 'all');
define('BILLABLE_FILTER_BILLABLE', 'billable');
define('BILLABLE_FILTER_NOT_BILLABLE', 'not_billable');
define('BILLABLE_FILTER_BILLABLE_BILLED', 'billable_billed');
define('BILLABLE_FILTER_BILLABLE_NOT_BILLED', 'billable_not_billed');
define('BILLABLE_FILTER_PENDING_PAYMENT', 'pending_payment');
define('BILLABLE_STATUS_NOT_BILLABLE', 0);
define('BILLABLE_STATUS_BILLABLE', 1);
define('BILLABLE_STATUS_PENDING_PAYMENT', 2);
define('BILLABLE_STATUS_BILLED', 3);
require TIMETRACKING_MODULE_PATH . '/functions.php';
use_model('time_reports', TIMETRACKING_MODULE);
set_for_autoload(array('TimeRecord' => TIMETRACKING_MODULE_PATH . '/models/timetracking/TimeRecord.class.php', 'TimeRecords' => TIMETRACKING_MODULE_PATH . '/models/timetracking/TimeRecords.class.php', 'TimeAddedActivityLog' => TIMETRACKING_MODULE_PATH . '/models/activity_logs/TimeAddedActivityLog.class.php'));
/**
 * Return section URL
 *
 * @param Project $project
 * @param ProjectObject $object
 * @return string
 */
function timetracking_module_url($project, $object = null)
{
    $params = array('project_id' => $project->getId());
    if (instance_of($object, 'ProjectObject')) {
        $params['for'] = $object->getId();
    }
    // if
    return assemble_url('project_time', $params);
コード例 #6
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
define('PROJECT_PERMISSION_ACCESS', 1);
define('PROJECT_PERMISSION_CREATE', 2);
define('PROJECT_PERMISSION_MANAGE', 3);
define('API_DISABLED', 0);
define('API_READ_ONLY', 1);
define('API_READ_WRITE', 2);
define('PAGE_MESSAGE_INFO', 'info');
define('PAGE_MESSAGE_WARNING', 'warning');
define('PAGE_MESSAGE_ERROR', 'error');
define('PAGE_MESSAGE_PRIVATE', 'private');
define('PAGE_MESSAGE_TRASHED', 'trashed');
define('OBJECT_SOURCE_WEB', 'web');
// first aid statuses
define('FIRST_AID_STATUS_OK', '0');
define('FIRST_AID_STATUS_WARNING', '1');
define('FIRST_AID_STATUS_ERROR', '2');
define('SCHEDULED_TASK_FREQUENTLY', 'frequently');
define('SCHEDULED_TASK_HOURLY', 'hourly');
define('SCHEDULED_TASK_DAILY', 'daily');
// ---------------------------------------------------
//  Load
// ---------------------------------------------------
require_once SYSTEM_MODULE_PATH . '/models/ApplicationObject.class.php';
use_model(array('modules', 'users', 'companies', 'roles', 'config_options', 'languages', 'email_templates', 'project_groups', 'projects', 'activity_logs', 'project_objects', 'project_users'), SYSTEM_MODULE);
require_once SYSTEM_MODULE_PATH . '/models/Wireframe.class.php';
require_once SYSTEM_MODULE_PATH . '/models/UserConfigOptions.class.php';
require_once SYSTEM_MODULE_PATH . '/models/StarredObjects.class.php';
require_once SYSTEM_MODULE_PATH . '/controllers/ApplicationController.class.php';
require_once SYSTEM_MODULE_PATH . '/models/search_engines/' . SEARCH_ENGINE . '.class.php';
set_for_autoload(array('CompanyConfigOptions' => SYSTEM_MODULE_PATH . '/models/CompanyConfigOptions.class.php', 'PinnedProjects' => SYSTEM_MODULE_PATH . '/models/PinnedProjects.class.php', 'AnonymousUser' => SYSTEM_MODULE_PATH . '/models/AnonymousUser.class.php', 'Thumbnails' => SYSTEM_MODULE_PATH . '/models/Thumbnails.class.php', 'ProjectObjectViews' => SYSTEM_MODULE_PATH . '/models/ProjectObjectViews.class.php', 'Permissions' => SYSTEM_MODULE_PATH . '/models/Permissions.class.php', 'ApplicationMailer' => SYSTEM_MODULE_PATH . '/models/ApplicationMailer.class.php', 'ObjectCreatedActivityLog' => SYSTEM_MODULE_PATH . '/models/activity_logs/ObjectCreatedActivityLog.class.php', 'ObjectUpdatedActivityLog' => SYSTEM_MODULE_PATH . '/models/activity_logs/ObjectUpdatedActivityLog.class.php', 'ObjectTrashedActivityLog' => SYSTEM_MODULE_PATH . '/models/activity_logs/ObjectTrashedActivityLog.class.php', 'ObjectRestoredActivityLog' => SYSTEM_MODULE_PATH . '/models/activity_logs/ObjectRestoredActivityLog.class.php', 'CommentsLockedActivityLog' => SYSTEM_MODULE_PATH . '/models/activity_logs/CommentsLockedActivityLog.class.php', 'CommentsUnlockedActivityLog' => SYSTEM_MODULE_PATH . '/models/activity_logs/CommentsUnlockedActivityLog.class.php'));
コード例 #7
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
<?php

/**
 * Init discussions module
 *
 * @package activeCollab.modules.milestones
 */
define('MILESTONES_MODULE', 'milestones');
define('MILESTONES_MODULE_PATH', APPLICATION_PATH . '/modules/milestones');
set_for_autoload(array('Milestone' => MILESTONES_MODULE_PATH . '/models/Milestone.class.php', 'Milestones' => MILESTONES_MODULE_PATH . '/models/Milestones.class.php'));
/**
 * Return section URL
 *
 * @param Project $project
 * @return string
 */
function milestones_module_url($project)
{
    return assemble_url('project_milestones', array('project_id' => $project->getId()));
}
// milestones_module_url
/**
 * Return add milestone ULRL
 *
 * @param Project $project
 * @return string
 */
function milestones_module_add_url($project)
{
    return assemble_url('project_milestones_add', array('project_id' => $project->getId()));
}
コード例 #8
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
define('FILE_TYPE_VIDEO', 'video');
define('FILE_TYPE_AUDIO', 'audio');
define('FILE_TYPE_UNKNOWN', 'unknown');
define('DATE_FILTER_LATE', 'late');
define('DATE_FILTER_TODAY', 'today');
define('DATE_FILTER_TOMORROW', 'tomorrow');
define('DATE_FILTER_LAST_WEEK', 'last_week');
define('DATE_FILTER_THIS_WEEK', 'this_week');
define('DATE_FILTER_NEXT_WEEK', 'next_week');
define('DATE_FILTER_LAST_MONTH', 'last_month');
define('DATE_FILTER_THIS_MONTH', 'this_month');
define('DATE_FILTER_NEXT_MONTH', 'next_month');
define('DATE_FILTER_SELECTED_DATE', 'selected_date');
define('DATE_FILTER_SELECTED_RANGE', 'selected_range');
define('PROJECT_FILTER_ACTIVE', 'active');
define('PROJECT_FILTER_SELECTED', 'selected');
define('USER_FILTER_ANYBODY', 'anybody');
define('USER_FILTER_NOT_ASSIGNED', 'not_assigned');
define('USER_FILTER_LOGGED_USER', 'logged_user');
define('USER_FILTER_LOGGED_USER_RESPONSIBLE', 'logged_user_responsible');
define('USER_FILTER_COMPANY', 'company');
define('USER_FILTER_SELECTED', 'selected');
define('ATTACHMENT_TYPE_ATTACHMENT', 'attachment');
define('ATTACHMENT_TYPE_FILE_REVISION', 'file_revision');
define('STATUS_FILTER_ACTIVE', 'active');
define('STATUS_FILTER_COMPLETED', 'completed');
define('STATUS_FILTER_ALL', 'all');
define('COMPLETED_TASKS_PER_OBJECT', 3);
use_model(array('assignments', 'subscriptions', 'assignment_filters', 'reminders', 'attachments'), RESOURCES_MODULE);
set_for_autoload(array('Comment' => RESOURCES_MODULE_PATH . '/models/comments/Comment.class.php', 'Comments' => RESOURCES_MODULE_PATH . '/models/comments/Comments.class.php', 'Category' => RESOURCES_MODULE_PATH . '/models/categories/Category.class.php', 'Categories' => RESOURCES_MODULE_PATH . '/models/categories/Categories.class.php', 'Task' => RESOURCES_MODULE_PATH . '/models/tasks/Task.class.php', 'Tasks' => RESOURCES_MODULE_PATH . '/models/tasks/Tasks.class.php', 'Attachment' => RESOURCES_MODULE_PATH . '/models/attachments/Attachment.class.php', 'Attachments' => RESOURCES_MODULE_PATH . '/models/attachments/Attachments.class.php', 'Tags' => RESOURCES_MODULE_PATH . '/models/tags/Tags.class.php', 'NewTaskActivityLog' => RESOURCES_MODULE_PATH . '/models/activity_logs/NewTaskActivityLog.class.php', 'TaskCompletedActivityLog' => RESOURCES_MODULE_PATH . '/models/activity_logs/TaskCompletedActivityLog.class.php', 'TaskReopenedActivityLog' => RESOURCES_MODULE_PATH . '/models/activity_logs/TaskReopenedActivityLog.class.php', 'NewCommentActivityLog' => RESOURCES_MODULE_PATH . '/models/activity_logs/NewCommentActivityLog.class.php'));
require_once RESOURCES_MODULE_PATH . '/functions.php';
コード例 #9
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
<?php

/**
 * Init files module
 *
 * @package activeCollab.modules.files
 */
define('FILES_MODULE', 'files');
define('FILES_MODULE_PATH', APPLICATION_PATH . '/modules/files');
set_for_autoload(array('File' => FILES_MODULE_PATH . '/models/File.class.php', 'Files' => FILES_MODULE_PATH . '/models/Files.class.php', 'NewFileActivityLog' => FILES_MODULE_PATH . '/models/activity_logs/NewFileActivityLog.class.php', 'NewFileVersionActivityLog' => FILES_MODULE_PATH . '/models/activity_logs/NewFileVersionActivityLog.class.php'));
/**
 * Return section URL
 *
 * @param Project $project
 * @param array $additional_params
 * @return string
 */
function files_module_url($project, $additional_params = null)
{
    $params = array('project_id' => $project->getId());
    if ($additional_params) {
        if (isset($additional_params['page'])) {
            $params['page'] = $additional_params['page'];
        }
        // if
        if (isset($additional_params['category_id'])) {
            $params['category_id'] = $additional_params['category_id'];
        }
        // if
        if (isset($additional_params['show_attachments'])) {
            $params['show_attachments'] = $additional_params['show_attachments'];
コード例 #10
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
<?php

/**
 * Init pages module
 *
 * @package activeCollab.modules.pages
 */
define('PAGES_MODULE', 'pages');
define('PAGES_MODULE_PATH', APPLICATION_PATH . '/modules/pages');
set_for_autoload(array('Page' => PAGES_MODULE_PATH . '/models/Page.class.php', 'Pages' => PAGES_MODULE_PATH . '/models/Pages.class.php', 'NewPageVersionActivityLog' => PAGES_MODULE_PATH . '/models/activity_logs/NewPageVersionActivityLog.class.php'));
use_model('page_versions', PAGES_MODULE);
/**
 * Return pages section URL
 *
 * @param Project $project
 * @return string
 */
function pages_module_url($project)
{
    return assemble_url('project_pages', array('project_id' => $project->getId()));
}
// pages_module_url
/**
 * Return add page ULRL
 *
 * @param Project $project
 * @param array $additional_params
 * @return string
 */
function pages_module_add_page_url($project, $additional_params = null, $parent = null)
{
コード例 #11
0
/**
 * Use model classes based on plural model name (categories, stories, 
 * news_entries etc)
 *
 * @param string $plural
 * @param string $module
 * @return null
 */
function use_model($plural, $module = DEFAULT_MODULE)
{
    if (is_array($plural)) {
        foreach ($plural as $model_name) {
            use_model($model_name, $module);
        }
        // foreach
    } else {
        $object_class = Inflector::camelize(Inflector::singularize($plural));
        $manager_class = Inflector::camelize($plural);
        if (CAN_AUTOLOAD) {
            set_for_autoload(array('Base' . $object_class => APPLICATION_PATH . "/modules/{$module}/models/{$plural}/Base" . $object_class . '.class.php', $object_class => APPLICATION_PATH . "/modules/{$module}/models/{$plural}/" . $object_class . '.class.php', 'Base' . $manager_class => APPLICATION_PATH . "/modules/{$module}/models/{$plural}/Base" . $manager_class . '.class.php', $manager_class => APPLICATION_PATH . "/modules/{$module}/models/{$plural}/" . $manager_class . '.class.php'));
        } else {
            require_once APPLICATION_PATH . "/modules/{$module}/models/{$plural}/Base" . $object_class . '.class.php';
            require_once APPLICATION_PATH . "/modules/{$module}/models/{$plural}/" . $object_class . '.class.php';
            require_once APPLICATION_PATH . "/modules/{$module}/models/{$plural}/Base" . $manager_class . '.class.php';
            require_once APPLICATION_PATH . "/modules/{$module}/models/{$plural}/" . $manager_class . '.class.php';
        }
        // if
    }
    // if
}
コード例 #12
0
ファイル: init.php プロジェクト: NaszvadiG/activecollab_loc
<?php

/**
 * Init discussions module
 *
 * @package activeCollab.modules.checklists
 */
define('CHECKLISTS_MODULE', 'checklists');
define('CHECKLISTS_MODULE_PATH', APPLICATION_PATH . '/modules/checklists');
set_for_autoload(array('Checklist' => CHECKLISTS_MODULE_PATH . '/models/Checklist.class.php', 'Checklists' => CHECKLISTS_MODULE_PATH . '/models/Checklists.class.php'));
/**
 * Return section URL
 *
 * @param Project $project
 * @return string
 */
function checklists_module_url($project)
{
    return assemble_url('project_checklists', array('project_id' => $project->getId()));
}
// checklists_module_url
/**
 * Return checklist archive URL
 *
 * @param Project $project
 * @return string
 */
function checklists_module_archive_url($project)
{
    return assemble_url('project_checklists_archive', array('project_id' => $project->getId()));
}
コード例 #13
0
<?php

/**
 * Modulename module initialization file
 * 
 * @package activeCollab.modules.modulename
 */
define('MODULENAME_MODULE', 'modulename');
define('MODULENAME_MODULE_PATH', APPLICATION_PATH . '/modules/modulename');
use_model('modulename', MODULENAME_MODULE);
set_for_autoload(array('Modulename' => MODULENAME_MODULE_PATH . '/models/modulename/Modulename.class.php'));