当前位置: 首页>>代码示例>>PHP>>正文


PHP template::setNotification方法代码示例

本文整理汇总了PHP中template::setNotification方法的典型用法代码示例。如果您正苦于以下问题:PHP template::setNotification方法的具体用法?PHP template::setNotification怎么用?PHP template::setNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在template的用法示例。


在下文中一共展示了template::setNotification方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     if ($id > 0) {
         $lead = $this->getLead($id);
         // Comments
         $comments = new comments();
         if (isset($_POST['comment']) === true) {
             $values = array('text' => $_POST['text'], 'date' => date("Y-m-d H:i:s"), 'userId' => $_SESSION['userdata']['id'], 'moduleId' => $id, 'commentParent' => $_POST['father']);
             $comments->addComment($values, 'lead');
         }
         // files
         $file = new files();
         if (isset($_POST['upload'])) {
             if (isset($_FILES['file'])) {
                 $file->upload($_FILES, 'lead', $id);
                 $tpl->setNotification('FILE_UPLOADED', 'success');
             } else {
                 $tpl->setNotification('NO_FILE', 'error');
             }
         }
         $files = new files();
         $tpl->assign('files', $files->getFilesByModule('lead', $id));
         $tpl->assign('comments', $comments->getComments('lead', $id));
         $tpl->assign('contactInfo', $this->getLeadContact($id));
         $tpl->assign('lead', $lead);
     } else {
         $tpl->display('general.error');
     }
     $tpl->display('leads.showLead');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:32,代码来源:class.showLead.php

示例2: run

 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     //Only admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         if (isset($_GET['id']) === true) {
             $id = (int) $_GET['id'];
             $row = $this->getClient($id);
             $msgKey = '';
             $values = array('name' => $row['name'], 'street' => $row['street'], 'zip' => $row['zip'], 'city' => $row['city'], 'state' => $row['state'], 'country' => $row['country'], 'phone' => $row['phone'], 'internet' => $row['internet'], 'email' => $row['email']);
             if (isset($_POST['save']) === true) {
                 $values = array('name' => $_POST['name'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'internet' => $_POST['internet'], 'email' => $_POST['email']);
                 if ($values['name'] !== '') {
                     $this->editClient($values, $id);
                     $tpl->setNotification('EDIT_CLIENT_SUCCESS', 'success');
                 } else {
                     $tpl->setNotification('NO_NAME', 'error');
                 }
             }
             $tpl->assign('values', $values);
             $tpl->display('clients.editClient');
         } else {
             $tpl->display('general.error');
         }
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:33,代码来源:class.editClient.php

示例3: run

 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     $user = new users();
     //Only admins
     if ($user->isAdmin($_SESSION['userdata']['id'])) {
         $msgKey = '';
         if (isset($_POST['save']) === true) {
             $values = array('name' => $_POST['name'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'internet' => $_POST['internet'], 'email' => $_POST['email']);
             if ($values['name'] !== '') {
                 if ($this->isClient($values) !== true) {
                     $this->addClient($values);
                     $tpl->setNotification('ADD_CLIENT_SUCCESS', 'success');
                 } else {
                     $tpl->setNotification('CLIENT_EXISTS', 'error');
                 }
             } else {
                 $tpl->setNotification('NO_NAME', 'error');
             }
             $tpl->assign('values', $values);
         }
         $tpl->display('clients.newClient');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:31,代码来源:class.newClient.php

示例4: run

 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     $helper = new helper();
     $values = array('description' => '', 'dateFrom' => '', 'dateTo' => '', 'allDay' => '');
     if (isset($_POST['save']) === true) {
         if (isset($_POST['allDay']) === true) {
             $allDay = 'true';
         } else {
             $allDay = 'false';
         }
         if (isset($_POST['dateFrom']) === true && isset($_POST['timeFrom']) === true) {
             $dateFrom = $helper->date2timestamp($_POST['dateFrom'], $_POST['timeFrom']);
         }
         if (isset($_POST['dateTo']) === true && isset($_POST['timeTo']) === true) {
             $dateTo = $helper->date2timestamp($_POST['dateTo'], $_POST['timeTo']);
         }
         $values = array('description' => $_POST['description'], 'dateFrom' => $dateFrom, 'dateTo' => $dateTo, 'allDay' => $allDay);
         if ($values['description'] !== '') {
             if ($helper->validateTime($_POST['timeFrom']) === true) {
                 $this->addEvent($values);
                 $msgKey = $tpl->setNotification('SAVE_SUCCESS', 'success');
             } else {
                 $tpl->setNotification('WRONG_TIME_FORMAT', 'error');
             }
         } else {
             $tpl->setNotification('NO_DESCRIPTION', 'error');
         }
         $tpl->assign('values', $values);
     }
     $tpl->assign('helper', $helper);
     $tpl->display('calendar.addEvent');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:38,代码来源:class.addEvent.php

示例5: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $infoKey = '';
     //Build values array
     $values = array('name' => '', 'parent' => '', 'module' => '', 'action' => '', 'icon' => '');
     if (isset($_POST['save'])) {
         if (isset($_POST['module'])) {
             $module = str_replace('index.php?act=', '', $_POST['module']);
             $module = explode('.', $module);
             $action = $module[1];
             $module = $module[0];
             $values = array('name' => $_POST['name'], 'parent' => $_POST['parent'], 'module' => $module, 'action' => $action, 'icon' => $_POST['icon']);
             $this->addMenu($values);
             $tpl->setNotification('New menu item successfully created', 'success');
             // $infoKey = '<p>Erfolgreich hinzugefügt</p>';
         } else {
             $tpl->setNotification('MISSING_FIELDS', 'error');
         }
     }
     $getModuleLinks = $this->getAllModulesAsLinks();
     $tpl->assign('wholeMenu', $this->getWholeMenu());
     $tpl->assign('moduleLinks', $getModuleLinks);
     $tpl->assign('info', $infoKey);
     $tpl->assign('values', $values);
     $tpl->assign('applications', $this->applications);
     $tpl->display('setting.addMenu');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:34,代码来源:class.addMenu.php

示例6: run

 public function run()
 {
     $tpl = new template();
     $language = new language();
     $language->setModule('leads');
     $language->readIni();
     if (isset($_POST['save'])) {
         if (isset($_POST['name']) && isset($_POST['money']) && isset($_POST['referralSource'])) {
             $refValue = '';
             if ($_POST['referralValueOther'] != '') {
                 $refValue = $_POST['referralValueOther'];
             } else {
                 if ($_POST['referralSource'] == 5 && $_POST['referralValueClient'] > 0) {
                     $refValue = $_POST['referralValueClient'];
                 }
             }
             $values = array('name' => $_POST['name'], 'refSource' => $_POST['referralSource'], 'refValue' => $refValue, 'potentialMoney' => $_POST['money'], 'creatorId' => $_SESSION['userdata']['id']);
             $contact = array('name' => $_POST['clientName'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'email' => $_POST['email'], 'internet' => $_POST['internet']);
             if ($this->isLead($values['name']) !== true) {
                 $leadId = $this->addLead($values);
                 $this->addLeadContact($contact, $leadId);
                 $tpl->setNotification('EDIT_SUCCESS', 'success');
             } else {
                 $tpl->setNotification('LEAD_EXISTS', 'error');
             }
         } else {
             $tpl->setNotification('MISSING_FIELDS', 'error');
         }
     }
     $client = new clients();
     $tpl->assign('referralSources', $this->getReferralSources());
     $tpl->assign('clients', $client->getAll());
     $tpl->display('leads.addLead');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:34,代码来源:class.addLead.php

示例7: run

 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     $users = new users();
     $clients = new clients();
     if ($id && $id > 0) {
         $lead = $this->getLead($id);
         $contact = $this->getLeadContact($id);
         $values = array('user' => $contact['email'], 'password' => '', 'firstname' => '', 'lastname' => '', 'phone' => $contact['phone'], 'role' => 3, 'clientId' => $lead['clientId']);
         if (isset($_POST['save'])) {
             if (isset($_POST['user']) && isset($_POST['firstname']) && isset($_POST['lastname'])) {
                 $hasher = new PasswordHash(8, TRUE);
                 $values = array('user' => $_POST['user'], 'password' => $hasher->HashPassword($_POST['password']), 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'phone' => $_POST['phone'], 'role' => $_POST['role'], 'clientId' => $_POST['clientId']);
                 if ($users->usernameExist($values['user']) !== true) {
                     $users->addUser($values);
                     $tpl->setNotification('USER_CREATED', 'success');
                 } else {
                     $tpl->setNotification('USERNAME_EXISTS', 'error');
                 }
             } else {
                 $tpl->setNotification('MISSING_FIELDS', 'error');
             }
         }
         $tpl->assign('values', $values);
         $tpl->assign('clients', $clients->getAll());
         $tpl->assign('roles', $users->getRoles());
         $tpl->display('leads.convertToUser');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:32,代码来源:class.convertToUser.php

示例8: run

 public function run()
 {
     $tpl = new template();
     if (isset($_POST['save'])) {
         if (isset($_POST['title']) && isset($_POST['submoduleAlias'])) {
             $this->addWidget($_POST['submoduleAlias'], $_POST['title']);
             $tpl->setNotification('SAVE_SUCCESS', 'success');
         } else {
             $tpl->setNotification('MISSING_FIELDS', 'error');
         }
     }
     $setting = new setting();
     $tpl->assign('submodules', $setting->getAllSubmodules());
     $tpl->display('dashboard.addWidget');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:15,代码来源:class.addWidget.php

示例9: run

 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     if ($id > 0) {
         $lead = $this->getLead($id);
         $values = array('name' => $lead['name'], 'potentialMoney' => $lead['potentialMoney'], 'actualMoney' => $lead['actualMoney'], 'refSource' => $lead['refSource'], 'refValue' => $lead['refValue'], 'status' => $lead['status'], 'proposal' => $lead['proposal']);
         $clients = new clients();
         $dbClient = $clients->getClient($lead['clientId']);
         $client = array('name' => $dbClient['name'], 'street' => $dbClient['street'], 'zip' => $dbClient['zip'], 'city' => $dbClient['city'], 'state' => $dbClient['state'], 'country' => $dbClient['country'], 'phone' => $dbClient['phone'], 'email' => $dbClient['email'], 'internet' => $dbClient['internet']);
         if (isset($_POST['save'])) {
             if (isset($_FILES['file'])) {
                 if (htmlspecialchars($_FILES['file']['name']) !== '') {
                     $file = new files();
                     $file->upload($_FILES, 'lead', $id);
                 }
             }
             if (isset($_POST['name']) && isset($_POST['referralSource']) && isset($_POST['money']) && isset($_POST['status'])) {
                 $refValue = '';
                 if ($_POST['referralSource'] && $_POST['referralValueOther'] != '') {
                     $refValue = $_POST['referralValueOther'];
                 } else {
                     if ($_POST['referralSource'] == 5 && $_POST['referralValueClient'] > 0) {
                         $refValue = $_POST['referralValueClient'];
                     }
                 }
                 $values = array('name' => $_POST['name'], 'potentialMoney' => $_POST['money'], 'actualMoney' => $_POST['actualMoney'], 'refSource' => $_POST['referralSource'], 'refValue' => $refValue, 'status' => $_POST['status']);
                 $client = array('name' => $_POST['clientName'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'email' => $_POST['email'], 'internet' => $_POST['internet']);
                 $this->editLead($values, $id);
                 $clients->editClient($client, $lead['clientId']);
                 $tpl->setNotification('EDIT_SUCCESS', 'success');
             } else {
                 $tpl->setNotification('MISSING_FIELDS', 'error');
             }
         }
         $tpl->assign('client', $client);
         $tpl->assign('lead', $values);
     } else {
         $tpl->display('general.error');
     }
     $client = new clients();
     $tpl->assign('status', $this->getStatus());
     $tpl->assign('referralSources', $this->getReferralSources());
     $tpl->assign('clients', $client->getAll());
     $tpl->display('leads.editLead');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:46,代码来源:class.editLead.php

示例10: run

 public function run()
 {
     $tpl = new template();
     // Messages
     $msg = '';
     $id = NULL;
     // Compose
     if (isset($_POST['send'])) {
         if (isset($_POST['username']) && isset($_POST['subject']) && isset($_POST['content'])) {
             $values = array('from_id' => $_SESSION['userdata']['id'], 'to_id' => $_POST['username'], 'subject' => $_POST['subject'], 'content' => $_POST['content']);
             $this->sendMessage($values);
             $tpl->setNotification('MESSAGE_SENT', 'success');
         } else {
             $tpl->setNotification('MISSING_FIELDS', 'error');
         }
     }
     if (isset($_POST['reply'])) {
         if (isset($_POST['message'])) {
             $values = array('content' => $_POST['message'], 'to_id' => $_POST['to_id'], 'from_id' => $_SESSION['userdata']['id']);
             $this->reply($values, $_POST['parent_id']);
         }
     }
     $myMessages = $this->getMessages($_SESSION['userdata']['id']);
     $users = new users();
     $user = $users->getUser($_SESSION['userdata']['id']);
     if (!isset($_GET['id'])) {
         $messages = $this->getMessages($_SESSION['userdata']['id'], 1);
         foreach ($messages as $message) {
             $id = $message['id'];
         }
     } else {
         $id = $_GET['id'];
         $this->markAsRead($id);
     }
     $tpl->assign('info', $msg);
     $tpl->assign('displayId', $id);
     $tpl->assign('userEmail', $user['username']);
     $tpl->assign('messages', $myMessages);
     $tpl->assign('friends', $this->getPeople());
     $tpl->display('messages.showAll');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:41,代码来源:class.showAll.php

示例11: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     if (isset($_GET['id']) === true) {
         $id = (int) $_GET['id'];
         $row = $this->getMenuById($id);
         $infoKey = '';
         //Build values array
         $values = array('name' => $row['name'], 'link' => $row['link'], 'parent' => $row['parent'], 'inTopNav' => $row['inTopNav'], 'orderNum' => $row['orderNum'], 'application' => $row['application'], 'action' => $row['action'], 'module' => $row['module'], 'icon' => $row['icon']);
         if (isset($_POST['save'])) {
             if (isset($_POST['name'])) {
                 $action = '';
                 $module = '';
                 if (isset($_POST['module'])) {
                     $module = str_replace('index.php?act=', '', $_POST['module']);
                     $module = explode('.', $module);
                     $action = $module[1];
                     $module = $module[0];
                 }
                 $values = array('name' => $_POST['name'], 'module' => $module, 'action' => $action, 'icon' => $_POST['icon'], 'parent' => $_POST['parent']);
                 $this->editMenu($values, $id);
                 $tpl->setNotification('Menu item edited!', 'success');
             } else {
                 $tpl->setNotification('MISSING_FIELDS', 'error');
             }
         }
         $getModuleLinks = $this->getAllModulesAsLinks();
         //				$publicContent = new publicContent();
         //Assign vars
         //				$tpl->assign('articles', $publicContent->getAllArticles());
         //Assign vars
         $tpl->assign('wholeMenu', $this->getWholeMenu());
         $tpl->assign('moduleLinks', $getModuleLinks);
         $tpl->assign('info', $infoKey);
         $tpl->assign('values', $values);
         $tpl->assign('applications', $this->applications);
         $tpl->display('setting.editMenu');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:47,代码来源:class.editMenu.php

示例12: run

 public function run()
 {
     $tpl = new template();
     $currentModule = '';
     if (isset($_GET['id'])) {
         $currentModule = $_GET['id'];
     }
     if (isset($_POST['upload'])) {
         if (isset($_FILES['file'])) {
             $this->upload($_FILES, 'private', 0);
             $tpl->setNotification('FILE_UPLOADED', 'success');
         } else {
             $tpl->setNotification('NO_FILES', 'error');
         }
     }
     $tpl->assign('folders', $this->getFolders($currentModule));
     $tpl->assign('currentModule', $currentModule);
     $tpl->assign('modules', $this->getModules($_SESSION['userdata']['id']));
     $tpl->assign('imgExtensions', array('jpg', 'jpeg', 'png', 'gif', 'psd', 'bmp', 'tif', 'thm', 'yuv'));
     $tpl->assign('files', $this->getFilesByModule($currentModule, NULL, $_SESSION['userdata']['id']));
     $tpl->display('files.showAll');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:22,代码来源:class.showAll.php

示例13: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $hasher = new PasswordHash(8, TRUE);
     //only Admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         $values = array();
         if (isset($_POST['save'])) {
             $values = array('firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'user' => $_POST['user'], 'phone' => $_POST['phone'], 'role' => $_POST['role'], 'password' => $hasher->HashPassword($_POST['password']), 'clientId' => $_POST['client']);
             //Validation
             if ($values['user'] !== '') {
                 $helper = new helper();
                 if ($helper->validateEmail($values['user']) == 1) {
                     if ($hasher->CheckPassword($_POST['password'], $values['password']) && $_POST['password'] != '') {
                         if ($this->usernameExist($values['user']) === false) {
                             $this->addUser($values);
                             $tpl->setNotification('USER_ADDED', 'success');
                         } else {
                             $tpl->setNotification('USERNAME_EXISTS', 'error');
                         }
                     } else {
                         $tpl->setNotification('PASSWORDS_DONT_MATCH', 'error');
                     }
                 } else {
                     $tpl->setNotification('NO_VALID_EMAIL', 'error');
                 }
             } else {
                 $tpl->setNotification('NO_USERNAME', 'error');
             }
             $tpl->assign('values', $values);
         }
         $clients = new clients();
         $tpl->assign('clients', $clients->getAll());
         $tpl->assign('roles', $this->getRoles());
         $tpl->display('users.newUser');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:45,代码来源:class.newUser.php

示例14: run

 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     if ($id > 0) {
         if (isset($_POST['save'])) {
             $values = array('street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'internet' => $_POST['internet']);
             $this->addLeadContact($values, $id);
             $tpl->setNotification('EDIT_SUCCESS', 'success');
         }
     } else {
         $tpl->display('general.error');
     }
     $tpl->display('leads.addLeadContact');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:15,代码来源:class.addLeadContact.php

示例15: run

 /**
  * run - display template and edit data
  *
  * @access public
  * @return
  */
 public function run()
 {
     $tpl = new template();
     if (isset($_GET['id']) === true) {
         $id = (int) $_GET['id'];
         $msgKey = '';
         //Delete User
         if (isset($_POST['del']) === true) {
             $this->deleteMenu($id);
             $tpl->setNotification('Menu item deleted!', 'success');
         }
         //Assign variables
         $tpl->assign('msg', $msgKey);
         $tpl->display('setting.delMenu');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:24,代码来源:class.delMenu.php


注:本文中的template::setNotification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。