function main($itsp) { include "dwoo/dwooAutoload.php"; $valid = isValidUser(); if ($valid) { $tpl = new Dwoo_Template_File('templates/newedittask.tpl'); $this->dwoo = new Dwoo(); $jsfiles = array(); $jsfiles[] = array('jsfile' => 'js/newtask.js'); $jsfiles[] = array('jsfile' => 'js/tiny_mce/jquery.tinymce.js'); $jsfiles[] = array('jsfile' => 'js/tinymce.js'); include_once "urls_backend.php"; $urls = new urls_backend(); $currenttask = $urls->getGP("__taskid"); include_once "tasks_backend.php"; $tasks = new tasks_backend(); $submiturl = $_SERVER["HTTP_REFERER"]; $parent = $tasks->getParent($currenttask); while ($parent["id"] > 0) { $params = array(); $params["task"] = $parent["title"]; $params["__taskid"] = $parent["id"]; $breadcrumburl = $urls->newUrl("tasks", $params); $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => '' . htmlentities($parent["title"]) . '', 'sepstart' => '» '); $parent = $tasks->getParent($parent["pid"]); } $params = array(); $breadcrumburl = $urls->newUrl("tasks", $params); $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => 'Main'); $m_list = array_reverse($m_list); $markerArray = loggedInArray(); $markerArray["tasktitle"] = $tasks->getTaskInfo($currenttask, "title", 1); $markerArray["taskdescription"] = $tasks->getTaskInfo($currenttask, "description", 1); $markerArray["js_list"] = $jsfiles; $markerArray["taskid"] = $currenttask; $markerArray["submiturl"] = $submiturl; $markerArray["func"] = "update"; $progress = $tasks->getTaskInfo($currenttask, "progress"); $markerArray["p" . $progress] = "selected"; $markerArray["submitbtn"] = $itsp->bLang->getLL("page.tasks.updatetask"); $markerArray["m_list"] = $m_list; $markerArray["headertitle"] = $tasks->getTaskInfo($currenttask, "title"); $markerArray["selectedtask"] = $itsp->bLang->getLL("page.tasks.selectedtask"); $markerArray["tasktitletxt"] = $itsp->bLang->getLL("page.tasks.tasktitle"); $markerArray["taskdescriptiontxt"] = $itsp->bLang->getLL("page.tasks.description"); $markerArray["taskprogress"] = $itsp->bLang->getLL("page.tasks.progress"); $markerArray["tasknotstarted"] = $itsp->bLang->getLL("page.tasks.notstarted"); $markerArray["taskfinished"] = $itsp->bLang->getLL("closed"); $output = $this->dwoo->get($tpl, $markerArray); print $output; } else { print "access denied"; } }
function main($itsp) { $itsp->bLang->setLanguage($_GET["lang"]); include_once "dwoo/dwooAutoload.php"; $valid = isValidUser(); if ($valid) { $tpl = new Dwoo_Template_File('templates/home.tpl'); $dwoo = new Dwoo(); $markerArray = loggedInArray(); $output = $dwoo->get($tpl, $markerArray); print $output; } else { $tpl = new Dwoo_Template_File('templates/frontpage.tpl'); $dwoo = new Dwoo(); $markerArray = templateArray(); $markerArray["loginerror"] = "Failed to login"; $output = $dwoo->get($tpl, $markerArray); print $output; } }
function main($itsp) { include "dwoo/dwooAutoload.php"; if ($itsp->bUrl->getGP("s")) { user_backend::verifyUser($itsp->bUrl->getGP("s"), $itsp->bUrl->getGP("u"), 1); } $valid = isValidUser(); if ($valid) { $tpl = new Dwoo_Template_File('templates/verifieduser.tpl'); $dwoo = new Dwoo(); $params = array(); $homeurl = "/" . config::installpath . "" . $itsp->bUrl->newUrl("tasks", $params); $markerArray = loggedInArray(); $markerArray["pageVerifiedUserAccepted"] = $itsp->bLang->getLL("page.verifieduser.useraccepted"); $markerArray["pageVerifiedUserHomeUrl"] = $itsp->bLang->getLL("page.verifieduser.homeurl"); $markerArray["homeUrl"] = $homeurl; $output = $dwoo->get($tpl, $markerArray); print $output; } else { print "access denied"; } }
function main($itsp) { include_once "dwoo/dwooAutoload.php"; $valid = isValidUser(); if ($valid) { include_once "user_backend.php"; $userb = new user_backend(); if ($_POST) { $errormsg = ""; $errors = 0; $passwordok = 0; if ($_POST["username"]) { include_once "user_backend.php"; $userb = new user_backend(); if (!$userb->isUsernameAvail($_POST["username"])) { if ($errormsg != "") { $errormsg .= "<br />"; } $errormsg .= $itsp->bLang->getLL("page.myinfo.usernamenotavailable"); $errors++; } } if ($_POST["password"] != $_POST["repeatpassword"]) { if ($errormsg != "") { $errormsg .= "<br />"; } $errormsg .= $itsp->bLang->getLL("page.myinfo.notidenticalpasswords"); $errors++; } else { if ($_POST["password"] != "itsplanned") { $passwordok = 1; } } if (!preg_match('/^[^@]+@[a-zA-Z0-9._-]+\\.[a-zA-Z]+$/', $_POST["email"])) { if ($errormsg != "") { $errormsg .= "<br />"; } $errormsg .= $itsp->bLang->getLL("page.myinfo.novalidemail"); $errors++; } if ($errors == 0) { $userb->setUserInfo("realname", $_POST["realname"]); $userb->setUserInfo("username", $_POST["username"]); $userb->setUserInfo("email", $_POST["email"]); if ($passwordok) { $userb->setUserInfo("password", md5($_POST["password"])); } $userb->setUserSetting("layoutlanguage", $_POST["language"]); $itsp->bLang->setLanguage($_POST["language"]); } } $tpl = new Dwoo_Template_File('templates/myinfo.tpl'); $dwoo = new Dwoo(); $language = $userb->getUserSetting("layoutlanguage"); $markerArray = loggedInArray(); $markerArray["pageMyinfoUsername"] = $itsp->bLang->getLL("page.myinfo.username"); $markerArray["pageMyinfoNewPassword"] = $itsp->bLang->getLL("page.myinfo.newpassword"); $markerArray["pageMyinfoNewPasswordRepeat"] = $itsp->bLang->getLL("page.myinfo.newpasswordrepeat"); $markerArray["pageMyinfoRealname"] = $itsp->bLang->getLL("page.myinfo.realname"); $markerArray["pageMyinfoEmail"] = $itsp->bLang->getLL("page.myinfo.email"); $markerArray["pageMyinfoUpdate"] = $itsp->bLang->getLL("page.myinfo.update"); $markerArray["pageMyinfoLayoutLanguage"] = $itsp->bLang->getLL("page.myinfo.layoutlanguage"); $markerArray["pageMyinfoErrorMsg"] = $errormsg; $markerArray["password"] = "******"; $markerArray["email"] = $userb->getUserInfo("email"); $markerArray["realname"] = $userb->getUserInfo("realname"); $markerArray["languageset" . $language] = " selected=selected "; $markerArray["headertitle"] = $itsp->bLang->getLL("page.myinfo.title"); $page = $dwoo->get($tpl, $markerArray); print $page; } else { print "access denied"; } }
function main($itsp) { include "dwoo/dwooAutoload.php"; $valid = isValidUser(); if ($valid) { include_once "urls_backend.php"; $urls = new urls_backend(); include_once "tasks_backend.php"; $tasks = new tasks_backend(); $this_url = "http://" . $_SERVER["SERVER_NAME"] . "" . $_SERVER["REQUEST_URI"]; if ($_POST["func"] == "create") { $_pid = $urls->getGP("__taskid"); $_title = $_POST["tasktitle"]; $_description = $_POST["taskdescription"]; $tasks->createNewTask($_pid, $_title, $_description); header("Location: {$this_url}#", TRUE, 302); exit; } if ($_POST["func"] == "update" && !isset($_POST["delete"])) { $_id = $_POST["taskid"]; $_title = $_POST["tasktitle"]; $_description = $_POST["taskdescription"]; $tasks->updateTask($_id, $_title, $_description); $tasks->setField($_id, "progress", $_POST["taskprogress"]); header("Location: {$this_url}#", TRUE, 302); exit; } if (isset($_POST["delete"])) { $_id = $_POST["taskid"]; $tasks->setField($_id, "deleted", 1); header("Location: {$this_url}#", TRUE, 302); exit; } $tpl = new Dwoo_Template_File('templates/tasks.tpl'); $this->dwoo = new Dwoo(); $currenttask = $urls->getGP("__taskid"); $currenttitle = $urls->getGP("task"); $jsfiles = array(); $jsfiles[] = array('jsfile' => 'js/jquery-ui-1.8.4.custom.min.js'); $jsfiles[] = array('jsfile' => 'js/tasklist.php?t=' . $currenttask); $jsfiles[] = array('jsfile' => 'js/widgetTreeList.js'); $tasklist = $this->getSubTasks(0, 0); $markerArray = array(); $markerArray["ulid"] = ""; $markerArray["ulclass"] = "newul"; $markerArray = loggedInArray(); $markerArray["js_list"] = $jsfiles; $_tasks = $this->getSubTasks($currenttask ? $currenttask : 0, 0, 99); $_closedtasks = $this->getSubTasks($currenttask ? $currenttask : 0, 0, 100, "="); $m_list = array(); $getParent = 1; $parent = $tasks->getParent($currenttask); while ($parent["id"] > 0) { $params = array(); $params["task"] = $parent["title"]; $params["__taskid"] = $parent["id"]; $breadcrumburl = $urls->newUrl("tasks", $params); $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => '' . $parent["title"] . '', 'sepstart' => '» '); $parent = $tasks->getParent($parent["pid"]); } $params = array(); $breadcrumburl = $urls->newUrl("tasks", $params); $m_list[] = array('breadcrumburl' => '' . $breadcrumburl . '', 'breadcrumbitem' => 'Main'); $m_list = array_reverse($m_list); $p_list = array(); $openmsg = $itsp->bLang->getLL("open"); $closedmsg = $itsp->bLang->getLL("closed"); $toggleinfomsg = $itsp->bLang->getLL("page.tasks.toggleinfo"); $movethismsg = $itsp->bLang->getLL("page.tasks.movethis"); $dontmovethismsg = stripslashes($itsp->bLang->getLL("page.tasks.dontmovethis")); $user = new user_backend(); $moveableTasks = unserialize($user->getUserSetting("movingTasks")); $moveherevisible = "show"; if ($moveableTasks == "") { $moveherevisible = "hide"; } if (count($moveableTasks) < 1) { $moveherevisible = "hide"; } foreach ($_tasks as $key => $value) { $params = array(); $params["task"] = $currenttitle . "/" . $value["title"]; $params["__taskid"] = $value["id"]; $taskurl = $urls->newUrl("tasks", $params); $edittaskurl = $urls->newUrl("edittask", $params); $subtasks = $tasks->getNumberOfSubTasks($value["id"]); $opensubtasks = $tasks->getNumberOfSubTasks($value["id"], 100); $status = $tasks->getTaskInfo($value["id"], "progress"); if ($status < 100) { $status = $openmsg; } else { $status = $closedmsg; } $created = $tasks->getTaskInfo($value["id"], "crdate"); if ($created > 0) { $created = date("d.m.Y", $created); } else { $created = "N/A"; } $toggleonoff = "strike nolink"; if ($value["description"] != "") { $toggleonoff = ""; } $p_list[] = array('liid' => "liid_" . $value["id"], 'liclass' => 'taskframe', 'licontent' => '' . $value["title"], 'taskurl' => '' . $taskurl . '', 'edittaskurl' => '' . $edittaskurl . '', 'subtasks' => '' . $subtasks . '', 'opensubtasks' => '' . $opensubtasks . '', 'toggleinfomsg' => '' . $toggleinfomsg . '', 'moveablemsg' => $moveableTasks[$value["id"]] ? $dontmovethismsg : $movethismsg, 'toggleonoff' => '' . $toggleonoff . '', 'created' => '' . $created . '', 'status' => '' . $status . '', 'statustxt' => $itsp->bLang->getLL("page.tasks.statustxt"), 'createdtxt' => $itsp->bLang->getLL("page.tasks.createdtxt"), 'opensubtaskstxt' => $itsp->bLang->getLL("page.tasks.opensubtaskstxt"), 'subtaskstxt' => $itsp->bLang->getLL("page.tasks.subtasks"), 'edittask' => $itsp->bLang->getLL("page.tasks.edittask"), 'state' => 'open', 'id' => $value["id"], 'taskdescription' => '' . $value["description"] . ''); } foreach ($_closedtasks as $key => $value) { $params = array(); $params["task"] = $currenttitle . "/" . $value["title"]; $params["__taskid"] = $value["id"]; $taskurl = $urls->newUrl("tasks", $params); $edittaskurl = $urls->newUrl("edittask", $params); $subtasks = $tasks->getNumberOfSubTasks($value["id"]); $opensubtasks = $tasks->getNumberOfSubTasks($value["id"], 100); $status = $tasks->getTaskInfo($value["id"], "progress"); if ($status < 100) { $status = $openmsg; } else { $status = $closedmsg; } $created = $tasks->getTaskInfo($value["id"], "crdate"); if ($created > 0) { $created = date("d.m.Y", $created); } else { $created = "N/A"; } $p_list[] = array('liid' => "liid_" . $value["id"], 'liclass' => 'taskframe', 'licontent' => '' . $value["title"], 'taskurl' => '' . $taskurl . '', 'edittaskurl' => '' . $edittaskurl . '', 'subtasks' => '' . $subtasks . '', 'opensubtasks' => '' . $opensubtasks . '', 'created' => '' . $created . '', 'status' => '' . $status . '', 'state' => 'closed', 'toggleinfomsg' => '' . $toggleinfomsg . '', 'moveablemsg' => $moveableTasks[$value["id"]] ? $dontmovethismsg : $movethismsg, 'statustxt' => $itsp->bLang->getLL("page.tasks.statustxt"), 'createdtxt' => $itsp->bLang->getLL("page.tasks.createdtxt"), 'opensubtaskstxt' => $itsp->bLang->getLL("page.tasks.opensubtaskstxt"), 'subtaskstxt' => $itsp->bLang->getLL("page.tasks.subtasks"), 'edittask' => $itsp->bLang->getLL("page.tasks.edittask"), 'id' => $value["id"], 'taskdescription' => '' . $value["description"] . ''); } $p_list[] = array('liid' => "liid_newtask", 'liclass' => 'liid_newtask', 'licontent' => '', 'taskurl' => '', 'taskdescription' => ''); $markerArray["p_list"] = $p_list; $markerArray["m_list"] = $m_list; $thistask = $urls->getGP("__taskid"); $params = array(); $params["task"] = $currenttitle; $params["__taskid"] = $currenttask; $newtask = $urls->newUrl("newtask", $params); $checkedall = ""; $showclosed = ""; if ($user->getUserSetting("showAllField") == "on") { $checkedall = " checked=checked "; } if ($user->getUserSetting("showClosedTasks") == "on") { $showclosed = " checked=checked "; } if ($user->getUserSetting("showCompactMode") == "on") { $showcompact = " checked=checked "; } $_title = $tasks->getTaskInfo($thistask, "title"); $markerArray["taskdescription"] = $tasks->getTaskInfo($thistask, "description"); $markerArray["taskname"] = $_title; $markerArray["headertitle"] = $_title ? $_title : $itsp->bLang->getLL("page.tasks.maintitle"); $markerArray["newtaskurl"] = $newtask; $markerArray["showallinfochecked"] = $checkedall; $markerArray["showclosedchecked"] = $showclosed; $markerArray["showcompactmodechecked"] = $showcompact; $markerArray["movetaskshere"] = $itsp->bLang->getLL("page.tasks.movetaskshere_1") . " <span class=\"movecount\">" . count($moveableTasks) . "</span>" . $itsp->bLang->getLL("page.tasks.movetaskshere_2"); $markerArray["moveherevisible"] = $moveherevisible; $markerArray["selectedtask"] = $itsp->bLang->getLL("page.tasks.selectedtask"); $markerArray["task"] = $itsp->bLang->getLL("page.tasks.task"); $markerArray["description"] = $itsp->bLang->getLL("page.tasks.description"); $markerArray["subtasks"] = $itsp->bLang->getLL("page.tasks.subtasks"); $markerArray["showallinfo"] = $itsp->bLang->getLL("page.tasks.options.showallinfo"); $markerArray["showclosedtasks"] = $itsp->bLang->getLL("page.tasks.options.showclosedtasks"); $markerArray["showcompactmode"] = $itsp->bLang->getLL("page.tasks.options.compactmode"); $markerArray["options"] = $itsp->bLang->getLL("page.tasks.options"); $markerArray["newtask"] = $itsp->bLang->getLL("page.tasks.newtask"); $settings = $this->dwoo->get($tpl, $markerArray); print $settings; } else { print "access denied"; } }