Example #1
0
 public function index()
 {
     $this->view->setTitle("Выход");
     $ui = new Model_Ui();
     session_destroy();
     $ui->stopSess($this->registry["ui"]["id"]);
     $this->view->refresh(array("timer" => "1", "url" => ""));
 }
Example #2
0
 public function setSet($param)
 {
     $key = $param["key"];
     $type = $param["type"];
     $ui = new Model_Ui();
     $res = $this->registry["users_sets"];
     $check = $res;
     $res[$type][$param["val"]] = $param["bool"];
     $res = json_encode($res);
     if (is_array($check)) {
         $ui->setSet($key, $res);
     } else {
         $ui->addSet($key, $res);
     }
 }
Example #3
0
 public function index()
 {
     if (!$this->registry["auth"]) {
         $login = new Model_Ui();
         if (isset($_POST["submit"])) {
             if ($login->login($_POST["login"], $_POST["password"])) {
                 echo $this->view->render("refresh", array("timer" => "1", "url" => ""));
             } else {
                 echo $this->view->render("login", array("err" => TRUE, "url" => $this->registry["siteName"]));
             }
         } else {
             echo $this->view->render("login", array("url" => $this->registry["siteName"]));
         }
     } else {
         $this->__call();
     }
 }
Example #4
0
 public function index()
 {
     $this->view->setTitle("Скин");
     $ui = new Model_Ui();
     if (isset($_POST["submit"])) {
         $ui->setSkin($_POST["skin"]);
         $this->view->refresh(array("timer" => "1", "url" => "profile/skin/"));
     }
     if ($dh = opendir($this->registry["rootPublic"] . "/" . $this->registry["path"]["skins"])) {
         while (false !== ($filename = readdir($dh))) {
             if ($filename != "." and $filename != "..") {
                 $skins[] = $filename;
             }
         }
     }
     $this->view->skin(array("skins" => $skins));
 }
Example #5
0
 function run()
 {
     $view = new View_Index();
     $this->registry->set('view', $view);
     $ui = new Model_Ui();
     $loginSession =& $_SESSION["login"];
     if (isset($loginSession["id"])) {
         $ui->getInfo($loginSession);
         $mailClass = new Model_Mail();
         $folders = $mailClass->getFolders();
         $this->registry["view"]->setFolders($folders);
     } else {
         $login = new Controller_Login();
         $login->index();
         exit;
     }
 }
Example #6
0
 public static function hacer_menu_lateral()
 {
     $html = "\n";
     foreach (Model_Ui::llenar_menu() as $item) {
         foreach ($item as $nombre => $link) {
             $html .= "<div class='no-color' onmouseover='colorear(this)' onmouseout='nocolorear(this)'>" . HTML::anchor($link, $nombre) . "</div>\n";
         }
     }
     $html .= "\n";
     return $html;
 }
Example #7
0
 public function index()
 {
     $this->view->setTitle("Профиль");
     if (isset($_POST['editprofile'])) {
         $data = $this->registry["ui"];
         $validate = new Model_Validate();
         $ui = new Model_Ui();
         $err = array();
         if ($_POST["login"] != $this->registry["ui"]["login"]) {
             if ($txt = $validate->login($_POST["login"])) {
                 $err[] = $txt;
             }
         }
         if ($txt = $validate->name($_POST["name"])) {
             $err[] = $txt;
         }
         if ($txt = $validate->soname($_POST["soname"])) {
             $err[] = $txt;
         }
         if ($data["pass"] != $_POST["pass"]) {
             if ($txt = $validate->password($_POST["pass"])) {
                 $err[] = $txt;
             }
         }
         if (count($err) == 0) {
             $uid = $ui->editUser($this->registry["ui"]["id"], $_POST["login"], $_POST["name"], $_POST["soname"]);
             if ($data["pass"] != $_POST["pass"]) {
                 $ui->editUserPass($this->registry["ui"]["id"], $_POST["pass"]);
             }
             $this->view->refresh(array("timer" => "1", "url" => "profile/profile/"));
         } else {
             $this->view->profile(array("err" => $err, "post" => $_POST));
         }
     } else {
         $data = $this->registry["ui"];
         $this->view->profile(array("post" => $data));
     }
 }
Example #8
0
 function run()
 {
     $view = new View_Index();
     $this->registry->set('view', $view);
     $view->setDescription($this->registry["keywords"]);
     $view->setKeywords($this->registry["description"]);
     $ui = new Model_Ui();
     $loginSession =& $_SESSION["login"];
     if (isset($loginSession["id"])) {
         $ui->getInfo($loginSession);
     } else {
         if (mb_substr($this->registry["url"], 1, 3) == "api") {
             $api = new Api_Model_Login();
             if (!$api->login()) {
                 exit;
             }
         } else {
             $login = new Controller_Login();
             $login->index();
             exit;
         }
     }
     Modules_Modules::load();
 }
Example #9
0
 function start()
 {
     $view = new View_Index();
     $this->registry->set('view', $view);
     $view->setDescription($this->registry["keywords"]);
     $view->setKeywords($this->registry["description"]);
     $ui = new Model_Ui();
     if (isset($_POST[session_name()])) {
         session_id($_POST[session_name()]);
     }
     session_start();
     $loginSession =& $_SESSION["login"];
     if (isset($loginSession["id"])) {
         $ui->getInfo($loginSession);
         $this->registry["logs"] = new Model_Logs();
         $this->registry["user"] = new Model_User();
         $this->registry["user"]->setOnline();
         $ui = new Model_Ui();
         $this->registry->set("users_sets", $ui->getSet("bu"));
         $this->registry->set("ajax_notice_sets", $ui->getSet("ajax_notice"));
     } else {
         if (mb_substr($this->registry["url"], 1, 3) == "api") {
             $api = new Model_Api();
             if (!$api->login()) {
                 return false;
             }
         } else {
             $login = new Controller_Login();
             $login->index();
             return false;
         }
     }
     $modules = new Modules_Modules();
     $modules->load();
     return true;
 }
Example #10
0
 function start()
 {
     $view = new View_Index();
     $this->registry->set('view', $view);
     $ui = new Model_Ui();
     if (isset($_POST[session_name()])) {
         session_id($_POST[session_name()]);
     }
     session_start();
     $loginSession =& $_SESSION["login"];
     if (isset($loginSession["id"])) {
         $ui->getInfo($loginSession);
     } else {
         if (mb_substr($this->registry["url"], 1, 8) == "download") {
             $download = new Controller_Download();
             $download->index();
             exit;
         } else {
             $login = new Controller_Login();
             $login->index();
             exit;
         }
     }
 }
Example #11
0
 private function _sessTime()
 {
     if (isset($this->args[1]) and is_string($this->args[1])) {
         if (count($this->args) > 2) {
             $result = array();
             $count = count($this->args);
             for ($i = 2; $i < $count; $i++) {
                 $result[] = $this->args[$i];
                 $result = implode(" ", $result);
             }
             $uid = $this->registry["user"]->getUserId($this->args[1]);
             if (isset($uid)) {
                 $ui = new Model_Ui();
                 if ($this->args[2] == "today") {
                     $this->args[2] = date("Ymd");
                 }
                 $sessTime = $ui->getSess($uid, $this->args[2]);
                 $this->result = $this->array_to_string($sessTime);
             } else {
                 $this->result = "login invalid";
             }
         } else {
             $this->result = "Usage: sessTime login date [date format: 'Y-m-d' or 'Ymd']";
         }
     } else {
         $this->result = "Usage: sessTime login date [date format: 'Y-m-d' or 'Ymd']";
     }
     return true;
 }
Example #12
0
 public function index()
 {
     $this->view->setTitle("Задачи");
     $object = new Model_Object();
     $cal =& $_SESSION["cal"];
     if (isset($_GET["page"])) {
         if (is_numeric($_GET["page"])) {
             if (!$this->registry["tt"]->setPage($_GET["page"])) {
                 $this->__call("tt", "index");
             }
         }
     }
     if (isset($this->args[0])) {
         if ($this->args[0] == "task") {
             if (isset($this->args[1])) {
                 $this->registry["tt"]->links = "tt/" . $this->args[0] . "/" . $this->args[1] . "/";
             } else {
                 $this->registry["tt"]->links = "tt/" . $this->args[0] . "/";
             }
             if (isset($this->args[1])) {
                 if ($this->args[1] == "iter") {
                     $tasks = $this->registry["tt"]->getIterTasks();
                     $this->view->tt_caltype(array("caltype" => $cal["type"], "date" => $this->model->editDate(date("Y-m-d"))));
                 } elseif ($this->args[1] == "time") {
                     $tasks = $this->registry["tt"]->getTimeTasks();
                     $this->view->tt_caltype(array("caltype" => $cal["type"], "date" => $this->model->editDate(date("Y-m-d"))));
                 } elseif ($this->args[1] == "noiter") {
                     $tasks = $this->registry["tt"]->getNoiterTasks();
                     $this->view->tt_caltype(array("caltype" => $cal["type"], "date" => $this->model->editDate(date("Y-m-d"))));
                 } elseif ($this->args[1] == "me") {
                     $sortmytt =& $_SESSION["sortmytt"];
                     if (!isset($sortmytt["sort"]) or !isset($sortmytt["id"])) {
                         $sortmytt["sort"] = "date";
                         $sortmytt["id"] = "false";
                     }
                     $sort_groups = $this->registry["tt"]->getSortGroupsMe();
                     $this->view->setLeftContent($this->view->render("left_sortmytt", array("sort" => $sortmytt, "sg" => $sort_groups)));
                     $tasks = $this->registry["tt"]->getMeTasks();
                 }
             } else {
                 $this->__call("tt", "index");
             }
         } elseif ($this->args[0] == "date") {
             $this->registry["tt"]->links = "tt/" . $this->args[0] . "/" . $this->args[1] . "/";
             $this->view->tt_caltype(array("caltype" => $cal["type"], "date" => $this->model->editDate(date("Y-m-d", strtotime($this->args[1])))));
             $tasks = $this->registry["tt"]->getTasksDate($this->registry["ui"]["id"], $this->args[1]);
         } elseif ($this->args[0] == "oid") {
             $this->registry["tt"]->links = "tt/" . $this->args[0] . "/" . $this->args[1] . "/";
             $tasks = $this->registry["tt"]->getOidTasks($this->args[1]);
         }
     } else {
         $sortmytt =& $_SESSION["sortmytt"];
         if (!isset($sortmytt["sort"]) or !isset($sortmytt["id"])) {
             $sortmytt["sort"] = "date";
             $sortmytt["id"] = "false";
         }
         $sort_groups = $this->registry["tt"]->getSortGroups();
         $this->view->setLeftContent($this->view->render("left_sortmytt", array("sort" => $sortmytt, "sg" => $sort_groups)));
         $this->registry["tt"]->links = "tt/";
         $tasks = $this->registry["tt"]->getTasks();
     }
     if (count($tasks) == 0) {
         $this->view->setMainContent("<p style='margin: 10px'>Задачи не найдены</p>");
     }
     foreach ($tasks as $part) {
         if ($data = $this->registry["tt"]->getTask($part["id"])) {
             $numComments = $this->registry["tt"]->getNumComments($part["id"]);
             $newComments = $this->registry["tt"]->getNewCommentsFromTid($part["id"]);
             if ($data[0]["remote_id"] == 0) {
                 if (isset($this->registry["module_users"])) {
                     $author = $this->registry["user"]->getUserInfo($data[0]["who"]);
                 } else {
                     $ui = new Model_Ui();
                     $user = $ui->getInfo($val["uid"]);
                 }
             } else {
                 $author = $this->registry["tt_user"]->getRemoteUserInfo($data[0]["who"]);
             }
             $ruser = array();
             foreach ($data as $val) {
                 if (isset($val["uid"])) {
                     if ($val["uid"] != 0) {
                         if (isset($this->registry["module_users"])) {
                             $user = $this->registry["user"]->getUserInfo($val["uid"]);
                         } else {
                             $ui = new Model_Ui();
                             $user = $ui->getInfo($val["uid"]);
                         }
                         $ruser[] = "<a style='cursor: pointer' onclick='getUserInfo(" . $val["uid"] . ")'>" . $user["name"] . " " . $user["soname"] . "</a>";
                     }
                 }
                 if (isset($val["rgid"])) {
                     if ($val["rgid"] != 0) {
                         $ruser[] = "<span style='color: #5D7FA6'><b>" . $this->registry["user"]->getSubgroupName($val["rgid"]) . "</b></span>";
                     }
                 }
                 if ($val["all"] == 1) {
                     $ruser[] = "<span style='color: #D9A444'><b>Все</b></span>";
                 }
             }
             $cuser = $this->registry["user"]->getUserInfo($data[0]["cuid"]);
             $notObj = true;
             if (!($obj = $object->getShortObject($data[0]["oid"]))) {
                 $notObj = false;
             }
             $this->view->tt_task(array("data" => $data, "author" => $author, "ruser" => $ruser, "cuser" => $cuser, "notObj" => $notObj, "obj" => $obj, "numComments" => $numComments, "newComments" => $newComments));
             unset($ruser);
         } else {
             $this->view->setMainContent("<p style='margin: 10px0'>Задача не найдена</p>");
         }
     }
     //Отобразим пейджер
     if (count($this->registry["tt"]->pager) != 0) {
         $this->view->pager(array("pages" => $this->registry["tt"]->pager));
     }
     $this->view->showPage();
 }
Example #13
0
 public function index()
 {
     $this->view->setTitle("Группы задач");
     if ($this->registry["ui"]["admin"]) {
         $groups = $this->registry["tt"]->getGroups();
         $this->view->groups_tt(array("group" => $groups));
     }
     $groups = new Model_TTGroups();
     if (isset($_GET["clear"])) {
         unset($_SESSION["groups"]);
     }
     $groupsSess =& $_SESSION["groups"];
     if (isset($_POST["submit"])) {
         $_POST["sday"] = htmlspecialchars($_POST["sday"]);
         $_POST["smonth"] = htmlspecialchars($_POST["smonth"]);
         $_POST["syear"] = htmlspecialchars($_POST["syear"]);
         $_POST["fday"] = htmlspecialchars($_POST["fday"]);
         $_POST["fmonth"] = htmlspecialchars($_POST["fmonth"]);
         $_POST["fyear"] = htmlspecialchars($_POST["fyear"]);
         $groupsSess = $_POST;
     } else {
         if (!isset($groupsSess)) {
             $groupsSess = array();
         }
     }
     if (!isset($groupsSess["sday"])) {
         $groupsSess["sday"] = "01";
     }
     if (!isset($groupsSess["smonth"])) {
         $groupsSess["smonth"] = "01";
     }
     if (!isset($groupsSess["syear"])) {
         $groupsSess["syear"] = "2010";
     }
     if (!isset($groupsSess["fday"])) {
         $groupsSess["fday"] = date("d");
     }
     if (!isset($groupsSess["fmonth"])) {
         $groupsSess["fmonth"] = date("m");
     }
     if (!isset($groupsSess["fyear"])) {
         $groupsSess["fyear"] = date("Y");
     }
     $this->view->groups_date(array("date" => $groupsSess));
     if ($this->args[0] == "groups" or !isset($this->args[0])) {
         if (isset($this->args[1])) {
             $groups->links = "tt/groups/" . $this->args[1] . "/";
         }
         if (isset($_GET["page"])) {
             if (is_numeric($_GET["page"])) {
                 if (!$groups->setPage($_GET["page"])) {
                     $this->__call("groups", "groups");
                 }
             }
         }
         if (isset($this->args[1])) {
             $data = $groups->getGroupsStatFromGroups($groupsSess, $this->args[1]);
             if (!isset($this->args[2]) or $this->args[2] == "page") {
                 foreach ($data as $part) {
                     if ($data = $this->registry["tt"]->getTask($part["id"])) {
                         if ($data[0]["remote_id"] == 0) {
                             if (isset($this->registry["module_users"])) {
                                 $author = $this->registry["user"]->getUserInfo($data[0]["who"]);
                             } else {
                                 $ui = new Model_Ui();
                                 $user = $ui->getInfo($val["uid"]);
                             }
                         } else {
                             $author = $this->registry["tt_user"]->getRemoteUserInfo($data[0]["who"]);
                         }
                         //$author = $this->registry["user"]->getUserInfo($data[0]["who"]);
                         $ruser = array();
                         foreach ($data as $val) {
                             if (isset($val["uid"])) {
                                 if ($val["uid"] != 0) {
                                     $user = $this->registry["user"]->getUserInfo($val["uid"]);
                                     $ruser[] = "<a style='cursor: pointer' onclick='getUserInfo(" . $val["uid"] . ")'>" . $user["name"] . " " . $user["soname"] . "</a>";
                                 }
                             }
                             if (isset($val["rgid"])) {
                                 if ($val["rgid"] != 0) {
                                     $ruser[] = "<span style='color: #5D7FA6'><b>" . $this->registry["user"]->getSubgroupName($val["rgid"]) . "</b></span>";
                                 }
                             }
                             if ($val["all"] == 1) {
                                 $ruser[] = "<span style='color: #D9A444'><b>Все</b></span>";
                             }
                         }
                         $object = new Model_Object();
                         $cuser = $this->registry["user"]->getUserInfo($data[0]["cuid"]);
                         $notObj = true;
                         if (!($obj = $object->getShortObject($data[0]["oid"]))) {
                             $notObj = false;
                         }
                         $this->view->tt_taskshort(array("data" => $data, "author" => $author, "ruser" => $ruser, "cuser" => $cuser, "notObj" => $notObj, "obj" => $obj));
                         unset($ruser);
                     }
                 }
                 //Отобразим пейджер
                 if (count($groups->pager) != 0) {
                     $this->view->pager(array("pages" => $groups->pager));
                 }
             }
         } else {
             $data = $groups->getGroupsStat($groupsSess);
             $this->view->groups_groups(array("data" => $data));
         }
     }
     $this->view->showPage();
 }
Example #14
0
 function saveNotice($params)
 {
     $ui = new Model_Ui();
     $res["task"] = $params["task"];
     $res["com"] = $params["com"];
     $res["mail"] = $params["mail"];
     $res["obj"] = $params["obj"];
     $res["info"] = $params["info"];
     $res = json_encode($res);
     if (is_array($this->registry["ajax_notice_sets"])) {
         $ui->setSet("ajax_notice", $res);
     } else {
         $ui->addSet("ajax_notice", $res);
     }
 }
Example #15
0
 public function index()
 {
     $this->view->setTitle("Просмотр задачи");
     $author = array();
     $ruser = array();
     if (isset($this->args[0])) {
         if ($data = $this->registry["tt"]->getTask($this->args[0])) {
             if (count($data) > 0) {
                 $numComments = $this->registry["tt"]->getNumComments($this->args[0]);
                 $newComments = $this->registry["tt"]->getNewCommentsFromTid($this->args[0]);
                 $lastCommentDate = $this->registry["tt"]->addTaskView($this->args[0]);
                 if ($data[0]["remote_id"] == 0) {
                     if (isset($this->registry["module_users"])) {
                         $author = $this->registry["user"]->getUserInfo($data[0]["who"]);
                     } else {
                         $ui = new Model_Ui();
                         $user = $ui->getInfo($val["uid"]);
                     }
                 } else {
                     $author = $this->registry["tt_user"]->getRemoteUserInfo($data[0]["who"]);
                 }
                 foreach ($data as $part) {
                     if (isset($part["uid"])) {
                         if ($part["uid"] != 0) {
                             if (isset($this->registry["module_users"])) {
                                 $user = $this->registry["user"]->getUserInfo($part["uid"]);
                             } else {
                                 $ui = new Model_Ui();
                                 $user = $ui->getInfo($val["uid"]);
                             }
                             $ruser[] = "<a style='cursor: pointer' onclick='getUserInfo(" . $part["uid"] . ")'>" . $user["name"] . " " . $user["soname"] . "</a>";
                         }
                     }
                     if (isset($part["rgid"])) {
                         if ($part["rgid"] != 0) {
                             $ruser[] = "<span style='color: #5D7FA6'><b>" . $this->registry["user"]->getSubgroupName($part["rgid"]) . "</b></span>";
                         }
                     }
                     if ($part["all"] == 1) {
                         $ruser[] = "<span style='color: #D9A444'><b>Все</b></span>";
                     }
                 }
                 $group = null;
                 if ($data[0]["gid"] != "0") {
                     $group = $this->registry["tt"]->getGroupName($data[0]["gid"]);
                 }
                 $object = new Model_Object();
                 $ai = new Model_Ai();
                 $forms = $ai->getForms();
                 $cuser = $this->registry["user"]->getUserInfo($data[0]["cuid"]);
                 $notObj = false;
                 if ($obj = $object->getShortObject($data[0]["oid"])) {
                     $notObj = true;
                     $numTroubles = $object->getNumTroubles($data[0]["oid"]);
                     $advInfo = $ai->getAdvancedInfo($data[0]["oid"]);
                     $numAdvInfo = $ai->getNumAdvancedInfo($data[0]["oid"]);
                     $rObject = $this->registry["module_objects"]->renderObject($this->registry["ui"], $obj, $advInfo, $numAdvInfo, $forms, $numTroubles, $group);
                     $this->view->setMainContent($rObject);
                 }
                 $this->view->tt_task(array("data" => $data, "author" => $author, "ruser" => $ruser, "cuser" => $cuser, "numComments" => $numComments, "newComments" => $newComments, "notObj" => $notObj, "obj" => $obj));
                 $comments = $this->registry["tt"]->getComments($this->args[0]);
                 if (count($comments) > 0) {
                     $this->view->setMainContent("<div style='padding: 10px 0 20px 40px; font-size: 14px; color: #999'>Комментарии:</div>");
                 }
                 foreach ($comments as $part) {
                     if ($part["date"] >= $lastCommentDate) {
                         $new = true;
                     } else {
                         $new = false;
                     }
                     $this->view->tt_comment(array("comment" => $part, "data" => $data, "new" => $new));
                 }
                 if (!$data[0]["close"]) {
                     $status = $this->registry["tt"]->getCommentsStatus();
                     $this->view->tt_formcomment(array("tid" => $this->args[0], "status" => $status));
                 }
             } else {
                 $this->view->setMainContent("<p>Задача не найдена</p>");
             }
         } else {
             $this->view->setMainContent("<p>Задача не найдена</p>");
         }
     }
     $this->view->showPage();
 }
Example #16
0
 function delAva($profile)
 {
     $ui = new Model_Ui();
     $ui->delAva();
 }
Example #17
0
 public function index()
 {
     $this->view->setTitle("Поиск");
     $find = new Model_Find();
     $object = new Model_Object();
     if (isset($this->findSess["string"])) {
         $this->view->setMainContent("<p style='font-weight: bold; margin-bottom: 20px'>Поиск: " . $this->findSess["string"] . "</p>");
         if (isset($_GET["page"])) {
             if (is_numeric($_GET["page"])) {
                 if (!$find->setPage($_GET["page"])) {
                     $this->__call("find", "tasks");
                 }
             }
         }
         $find->links = "/" . $this->args[0] . "/";
         $text = substr($this->findSess["string"], 0, 64);
         $text = explode(" ", $text);
         $findArr = $find->findTroubles($text);
         if (!isset($this->args[1]) or $this->args[1] == "page") {
             foreach ($findArr as $part) {
                 if ($data = $this->registry["tt"]->getTask($part["id"])) {
                     $numComments = $this->registry["tt"]->getNumComments($part["id"]);
                     $newComments = $this->registry["tt"]->getNewCommentsFromTid($part["id"]);
                     if ($data[0]["remote_id"] == 0) {
                         if (isset($this->registry["module_users"])) {
                             $author = $this->registry["user"]->getUserInfo($data[0]["who"]);
                         } else {
                             $ui = new Model_Ui();
                             $user = $ui->getInfo($val["uid"]);
                         }
                     } else {
                         $author = $this->registry["tt_user"]->getRemoteUserInfo($data[0]["who"]);
                     }
                     $ruser = array();
                     foreach ($data as $val) {
                         if (isset($val["uid"])) {
                             if ($val["uid"] != 0) {
                                 if (isset($this->registry["module_users"])) {
                                     $user = $this->registry["user"]->getUserInfo($val["uid"]);
                                 } else {
                                     $ui = new Model_Ui();
                                     $user = $ui->getInfo($val["uid"]);
                                 }
                                 $ruser[] = "<a style='cursor: pointer' onclick='getUserInfo(" . $val["uid"] . ")'>" . $user["name"] . " " . $user["soname"] . "</a>";
                             }
                         }
                         if (isset($val["rgid"])) {
                             if ($val["rgid"] != 0) {
                                 $ruser[] = "<span style='color: #5D7FA6'><b>" . $this->registry["user"]->getSubgroupName($val["rgid"]) . "</b></span>";
                             }
                         }
                         if ($val["all"] == 1) {
                             $ruser[] = "<span style='color: #D9A444'><b>Все</b></span>";
                         }
                     }
                     $cuser = $this->registry["user"]->getUserInfo($data[0]["cuid"]);
                     $notObj = true;
                     if (!($obj = $object->getShortObject($data[0]["oid"]))) {
                         $notObj = false;
                     }
                     $this->view->find_tt_task(array("data" => $data, "author" => $author, "ruser" => $ruser, "cuser" => $cuser, "notObj" => $notObj, "obj" => $obj, "numComments" => $numComments, "newComments" => $newComments));
                 }
             }
             //Отобразим пейджер
             if (count($find->pager) != 0) {
                 $this->view->pager(array("pages" => $find->pager));
             }
         }
     }
 }
Example #18
0
		    <!-- FIN MENU -->
		    <?php 
echo $admin_lateral;
?>
	    		    <!-- MENU -->
	    		    <table>
	    			<tr>
	    			    <td class="arriba" colspan="3">
	    				<b>Lo m&aacute;s reciente</b>
	    			    </td>
	    			</tr>
	    			<tr>
	    			    <td class="izq">&nbsp;</td>
	    			    <td>
				<?php 
echo Model_Ui::hacer_lo_mas_reciente();
?>
			    </td>
			    <td class="der">&nbsp;</td>
			</tr>
			<tr>
			    <td class="abajo" colspan="3">&nbsp;</td>
			</tr>
		    </table>
		    <!-- FIN MENU -->
		    <div class="portales">
			<?php 
echo HTML::anchor("http://www.infocentro.gob.ve/", HTML::image("media/img/infocentro.jpg"));
?>
				<br>
			<?php 
Example #19
0
 public function index()
 {
     $this->view->setTitle("Учётная запись");
     $ui = new Model_Ui();
     if (isset($_POST["upload_avatar"])) {
         $err = $ui->saveAvatar($_FILES["filename"]);
         if ($err != null) {
             $this->view->setMainContent("<div style='border: 1px solid red; background-color: #faa; padding: 4px 10px; margin-bottom: 20px; width: 400px'>" . $err . "</div>");
         } else {
             $this->registry->remove("auth");
             $this->registry->remove("ui");
             $this->registry->remove("getNumMeTasks");
             $this->registry->remove("getNumTasks");
             $loginSession =& $_SESSION["login"];
             if (isset($loginSession["id"])) {
                 $ui->getInfo($loginSession);
             }
         }
     }
     if (isset($_POST['editprofile'])) {
         $data = $this->registry["ui"];
         $validate = new Model_Validate();
         $err = array();
         if ($_POST["login"] != $this->registry["ui"]["login"]) {
             if ($txt = $validate->login($_POST["login"])) {
                 $err[] = $txt;
             }
         }
         if ($txt = $validate->email($_POST["email"])) {
             $err[] = $txt;
         }
         if ($txt = $validate->name($_POST["name"])) {
             $err[] = $txt;
         }
         if ($txt = $validate->soname($_POST["soname"])) {
             $err[] = $txt;
         }
         if ($data["pass"] != $_POST["pass"]) {
             if ($txt = $validate->password($_POST["pass"])) {
                 $err[] = $txt;
             }
         }
         if (count($err) == 0) {
             if (!isset($_POST["notify"])) {
                 $notify = 0;
             } else {
                 $notify = 1;
             }
             if (isset($_POST["email_for_task"])) {
                 $email_for_task = 1;
             } else {
                 $email_for_task = 0;
             }
             $uid = $ui->editUser($this->registry["ui"]["id"], $_POST["login"], $_POST["name"], $_POST["soname"], $_POST["signature"], $_POST["email"], $notify, $_POST["time_notify"], $email_for_task);
             if ($data["pass"] != $_POST["pass"]) {
                 $ui->editUserPass($this->registry["ui"]["id"], $_POST["pass"]);
             }
             $ui->editAdvUser($_POST["icq"], $_POST["skype"], $_POST["adres"], $_POST["phone"]);
             $this->view->refresh(array("timer" => "1", "url" => "profile/profile/"));
         } else {
             $this->view->profile(array("err" => $err, "post" => $_POST));
         }
     } else {
         $data = $this->registry["ui"];
         $this->view->profile(array("post" => $data));
     }
 }