Example #1
0
 /** 获取列表搜索信息 **/
 public function getList()
 {
     $obj = new Project();
     $search = new search();
     if (!empty($this->PageIndex)) {
         $search->PageIndex = $this->PageIndex;
     }
     $search->PageSize = $this->PageSize;
     $obj->Type = $this->Type;
     $res = $obj->getList($search);
     echo json_encode($res);
     exit;
 }
Example #2
0
include_once APP_INC_PATH . "class.workflow.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("manage/index.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$tpl->assign("type", "projects");
$role_id = Auth::getCurrentRole();
if ($role_id == User::getRoleID('administrator') || $role_id == User::getRoleID('manager')) {
    if ($role_id == User::getRoleID('administrator')) {
        $tpl->assign("show_setup_links", true);
    }
    if (@$HTTP_POST_VARS["cat"] == "new") {
        $tpl->assign("result", Project::insert());
    } elseif (@$HTTP_POST_VARS["cat"] == "update") {
        $tpl->assign("result", Project::update());
    } elseif (@$HTTP_POST_VARS["cat"] == "delete") {
        Project::remove();
    }
    $tpl->assign("active_projects", Project::getAssocList(Auth::getUserID(), true));
    if (@$HTTP_GET_VARS["cat"] == "edit") {
        $tpl->assign("info", Project::getDetails($HTTP_GET_VARS["id"]));
    }
    $tpl->assign("list", Project::getList());
    $tpl->assign("user_options", User::getActiveAssocList(false, NULL, false, false, true));
    $tpl->assign("status_options", Status::getAssocList());
    $tpl->assign("customer_backends", Customer::getBackendList());
    $tpl->assign("workflow_backends", Workflow::getBackendList());
} else {
    $tpl->assign("show_not_allowed_msg", true);
}
$tpl->displayTemplate();
Example #3
0
 /**
  * Shows a list of available projects to the current user, for selection. Any
  * project for which the user has at least read access level.
  */
 public static function dashboard()
 {
     //
     // Small "hack" to always have a project in GLOBALS, even before
     // one is actively clicked and visited. This allows a default project
     // (tipically the first one) to already be selected in the dashboard
     // and the respective project menu item filled.
     //
     // This does take into account that if $GLOBALS['project'] gets here
     // empty, it's because the webHandler couldn't populate it.
     //
     // This probably isn't the best thing to do, since we're initializing
     // variables here that will be used throughout the system. If anything
     // changes on the webHandler, don't forget to reflect that here also.
     //
     $projects = Project::getList($GLOBALS['user'], Access::READ);
     if (!$GLOBALS['project'] instanceof Project && !empty($projects) && $projects[0] instanceof Project) {
         $GLOBALS['project'] = $projects[0];
         $_SESSION['projectId'] = $projects[0]->getId();
     }
     $GLOBALS['smarty']->assign('dashboard_projectList', $projects);
 }
Example #4
0
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/projects.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'new') {
    Misc::mapMessages(Project::insert(), array(1 => array(ev_gettext('Thank you, the project was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new project.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this new project.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    Misc::mapMessages(Project::update(), array(1 => array(ev_gettext('Thank you, the project was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the project information.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this project.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Misc::mapMessages(Project::remove(), array(1 => array(ev_gettext('Thank you, the project was deleted successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to delete the project.'), Misc::MSG_ERROR)));
}
$tpl->assign('active_projects', Project::getAssocList(Auth::getUserID(), true));
if (@$_GET['cat'] == 'edit') {
    $tpl->assign('info', Project::getDetails($_GET['id']));
}
$tpl->assign('list', Project::getList());
$tpl->assign('user_options', User::getActiveAssocList());
$tpl->assign('status_options', Status::getAssocList());
$tpl->assign('customer_backends', CRM::getBackendList());
$tpl->assign('workflow_backends', Workflow::getBackendList());
$tpl->displayTemplate();
    define('_DSN', _DBTYPE . '://' . _DBUSER . ':' . _DBPASS . '@' . _DBHOST . '/' . _DBNAME);
    $_SESSION['dsn'] = _DSN;
    $_SESSION['current_lang'] = $_REQUEST['lang'];
    if (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 6, 2) != "de") {
        $_SESSION['current_lang'] = "en";
    } else {
        $_SESSION['current_lang'] = "de";
    }
}
$_SESSION['translate'] = new Translate("../conf/lang/Messages.properties");
$_SESSION['template'] = new HTML_Template_IT(TEMPLATE_DIR);
$_SESSION['template']->loadTemplateFile(TEMPLATE_DIR . "template.tpl");
$template =& $_SESSION['template'];
User::checkLogin($template, $_SESSION['dsn']);
//$template->setVariable("PROJECTS", Project::getList($template, $_SESSION['dsn']));
Project::getList($template, $_SESSION['dsn']);
if (!empty($_REQUEST['getfile'])) {
    $file = $_REQUEST['getfile'];
    if (!stristr($file, "..")) {
        Download::download($file, "../../dist/");
    }
}
if (!empty($_REQUEST['getdoc'])) {
    $file = $_REQUEST['getdoc'];
    if (!stristr($file, "..")) {
        Download::download($file, "../../doc/");
    }
}
switch ($_REQUEST['lang']) {
    case "de":
        $_SESSION['current_lang'] = $_REQUEST['lang'];
Example #6
0
 /** 获取列表搜索信息 **/
 public function getList()
 {
     $project = new Project();
     $search = new ProjectSearch();
     $search->Type = $this->Type;
     $search->Department = $this->Department;
     $search->Team = $this->Team;
     $search->Status = $this->Status;
     $search->Developer = $this->Developer;
     $search->UserId = $this->UserId;
     $search->Order = $this->Order;
     $search->PageIndex = $this->PageIndex;
     $search->PageSize = $this->PageSize;
     $search->NeedCount = $this->NeedCount;
     $res = $project->getList($search);
     echo json_encode($res);
     exit;
 }