예제 #1
0
    foreach ($myOpenProjects as $proj) {
        // get all the tasks in this project that are assigned to the current user
        $task = $mtask->getAllMyProjectTasks($proj["ID"], 100);
        // get all messages in the project
        $msgs = $msg->getProjectMessages($proj["ID"]);
        // write those to arrays
        if (!empty($msgs)) {
            array_push($messages, $msgs);
        }
        if (!empty($task)) {
            array_push($tasks, $task);
        }
        $cou = $cou + 1;
    }
}
$myClosedProjects = $project->getMyProjects($userid, 0);
// If the user is allowed to add projects, also get all users to assign to those projects
if ($userpermissions["projects"]["add"]) {
    $user = new user();
    $users = $user->getAllUsers(1000000);
    $template->assign("users", $users);
    $company = new company();
    $companies = $company->getAllCompanies();
    $template->assign("customers", $companies);
}
// by default the arrays have a level for each project, whcih contains arrays for each message/task . reduce array flattens this to have all messages/tasks of all projects in one structure
if (!empty($messages)) {
    $messages = reduceArray($messages);
}
$etasks = reduceArray($tasks);
// Create sort array for multisort by adding the daysleft value to a sort array
예제 #2
0
파일: init.php 프로젝트: raum01/Collabtive
if (!file_exists(CL_ROOT . "/language/{$locale}/lng.conf")) {
    $locale = $settings['locale'];
    $_SESSION['userlocale'] = $locale;
}
// Set locale directory
$template->config_dir = CL_ROOT . "/language/{$locale}/";
// Smarty 3 seems to have a problem with re-compiling the config if the user config is different than the system config.
// this forces a compile of the config.
// uncomment this if you have issues with language switching
// $template->compileAllConfig('.config',true);
// read language file into PHP array
$langfile = readLangfile($locale);
$template->assign("langfile", $langfile);
$template->assign("locale", $locale);
// css classes for headmenue
// this indicates which of the 3 main stages the user is on
$mainclasses = array("desktop" => "desktop", "profil" => "profil", "admin" => "admin");
$template->assign("mainclasses", $mainclasses);
// get current year and month
$they = date("Y");
$them = date("n");
$template->assign("theM", $them);
$template->assign("theY", $they);
// Get the user's projects for the quickfinder in the sidebar
if (isset($userid)) {
    $project = new project();
    $myOpenProjects = $project->getMyProjects($userid);
    $template->assign("openProjects", $myOpenProjects);
}
// clear session data for pagination
SmartyPaginate::disconnect();
예제 #3
0
        $item->link = $loc;
        $item->source = $loc;
        $item->description = $mytask["text"];
        // optional
        $item->descriptionTruncSize = 500;
        $item->descriptionHtmlSyndicated = true;
        $item->pubDate = $mytask["start"];
        $item->author = "";
        $rss->addItem($item);
    }
    // valid format strings are: RSS0.91, RSS1.0, RSS2.0, PIE0.1 (deprecated),
    // MBOX, OPML, ATOM, ATOM0.3, HTML, JS
    echo $rss->saveFeed("RSS2.0", CL_ROOT . "/files/" . CL_CONFIG . "/ics/feedtask-{$user}.xml");
} elseif ($action == "mymsgs-rss") {
    $tproject = new project();
    $myprojects = $tproject->getMyProjects($user);
    $msg = new message();
    $messages = array();
    foreach ($myprojects as $proj) {
        $message = $msg->getProjectMessages($proj["ID"]);
        if (!empty($message)) {
            array_push($messages, $message);
        }
    }
    if (!empty($messages)) {
        $messages = reduceArray($messages);
    }
    $strpro = $langfile["project"];
    $tit = $langfile["mymessages"];
    $rss->title = $tit;
    $rss->description = "";
예제 #4
0
<?php

include "init.php";
if (!isset($_SESSION["userid"])) {
    $template->assign("loginerror", 0);
    $template->display("login.tpl");
    die;
}
$project = new project();
$user = new user();
$myprojects = $project->getMyProjects($userid);
$oldprojects = $project->getMyProjects($userid, 0);
$pnum = count($myprojects) + count($oldprojects);
$users = $user->getAllUsers(1000000);
$template->assign("users", $users);
$title = $langfile["myprojects"];
$template->assign("title", $title);
$template->assign("projectnum", $pnum);
$template->assign("myprojects", $myprojects);
$template->assign("oldprojects", $oldprojects);
$template->display("myprojects.tpl");
예제 #5
0
     $template->display("error.tpl");
     die;
 }
 // get all messages of this project
 $messages = $msg->getProjectMessages($id);
 // get project's name
 $myproject = new project();
 $pro = $myproject->getProject($id);
 $projectname = $pro['name'];
 $template->assign("projectname", $projectname);
 // get the page title
 // create new project and file objects
 $project = new project();
 $myfile = new datei();
 // get all uof the users projects
 $myprojects = $project->getMyProjects($userid);
 $cou = 0;
 $messages = array();
 // loop through the projects and get messages and files for each project
 if (!empty($myprojects)) {
     foreach ($myprojects as $proj) {
         $message = $msg->getProjectMessages($proj["ID"]);
         array_push($messages, $message);
     }
 }
 // flatten array
 $messages = reduceArray($messages);
 if (!empty($messages)) {
     $mcount = count($messages);
 } else {
     $mcount = 0;
예제 #6
0
 /**
  * Export all tasks of a user via iCal
  *
  * @param int $user User ID
  * @param bool $show_long
  * @return bool
  */
 function getIcal($user, $show_long = true)
 {
     $user = (int) $user;
     $show_long = (bool) $show_long;
     $username = $_SESSION["username"];
     $project = new project();
     $myprojects = $project->getMyProjects($user);
     $tasks = array();
     if (!empty($myprojects)) {
         foreach ($myprojects as $proj) {
             $task = $this->getAllMyProjectTasks($proj["ID"], 10000);
             if (!empty($task)) {
                 array_push($tasks, $task);
             }
         }
     }
     $etasks = reduceArray($tasks);
     require "class.ical.php";
     $heute = date("d-m-y");
     $cal = new vcalendar();
     $fname = "tasks_" . $username . ".ics";
     $cal->setConfig('directory', CL_ROOT . '/files/' . CL_CONFIG . '/ics');
     $cal->setConfig('filename', $fname);
     $cal->setConfig('unique_id', '');
     $cal->setProperty('X-WR-CALNAME', "Collabtive Aufgaben für " . $username);
     $cal->setProperty('X-WR-CALDESC', '');
     $cal->setProperty('CALSCALE', 'GREGORIAN');
     $cal->setProperty('METHOD', 'PUBLISH');
     foreach ($etasks as $etask) {
         // split date in Y / M / D / h / min / sek variables
         $jahr = date("Y", $etask["start"]);
         $monat = date("m", $etask["start"]);
         $tag = date("d", $etask["start"]);
         $std = date("h", $etask["start"]);
         $min = date("i", $etask["start"]);
         $sek = date("s", $etask["start"]);
         // split date in Y / M / D / h / min / sek variables
         $ejahr = date("Y", $etask['end']);
         $emonat = date("m", $etask['end']);
         $etag = date("d", $etask['end']);
         $estd = date("h", $etask['end']);
         $emin = date("i", $etask['end']);
         $esek = date("s", $etask['end']);
         $e = new vevent();
         $e->setProperty('categories', $etask['list']);
         if ($show_long) {
             // if we have a task lasting 10 month, normally it will be displayed every day within this time span.
             $e->setProperty('dtstart', $jahr, $monat, $tag, $std, $min);
             // 24 dec 2007 19.30
         } else {
             // if the show_long flag is set, it will only be shown at the due date
             $e->setProperty('dtstart', $ejahr, $emonat, $etag, $estd, $emin);
         }
         $e->setProperty('due', $ejahr, $emonat, $etag, $estd, $emin);
         // 24 dec 2007 19.30
         $e->setProperty('dtend', $ejahr, $emonat, $etag, $estd, $emin);
         $e->setProperty('description', $etask["text"]);
         $e->setProperty('status', "NEEDS-ACTION");
         // $e->setProperty('comment' , $etask[text]);
         $e->setProperty('summary', $etask["title"]);
         $e->setProperty('location', 'Work');
         $cal->setComponent($e);
     }
     $cal->returnCalendar();
     return true;
 }
예제 #7
0
            }
            header("Location: admin.php?action=users&mode=edited");
        }
    } else {
        if ($user->edit($id, $name, "", $email, $tel1, $tel2, $company, $zip, $gender, $turl, $address1, $address2, $state, $country, $tags, $locale, "", $rate)) {
            if (!empty($newpass) and !empty($repeatpass)) {
                $user->admin_editpass($id, $newpass, $repeatpass);
            }
            header("Location: admin.php?action=users&mode=edited");
        }
    }
} elseif ($action == "deleteuserform") {
    $usr = $user->getProfile($id);
    // Get user's projects
    $proj = new project();
    $projects = $proj->getMyProjects($id);
    // Get members of each project
    if (!empty($projects)) {
        for ($i = 0; $i < count($projects); $i++) {
            $members = $proj->getProjectMembers($projects[$i]["ID"]);
            $projects[$i]["members"] = $members;
        }
        $title = $langfile["deleteuser"];
        $template->assign("title", $title);
        $template->assign("user", $usr);
        $template->assign("projects", $projects);
        $template->display("admindeluserform.tpl");
    } else {
        if ($user->del($id)) {
            header("Location: admin.php?action=users&mode=deleted");
        }