Exemplo n.º 1
0
 public function enterAction()
 {
     $bug = new Bugs();
     $bug->summary = $_POST["summary"];
     $bug->description = $_POST["description"];
     $bug->status = "NEW";
     $accountsTable = Doctrine_Core::getTable("Accounts");
     $auth = Zend_Auth::getInstance();
     if ($auth && $auth->hasIdentity()) {
         $bug->reported_by = $auth->getIdentity();
     }
     $bug->save();
 }
 function editAction($bugs_id, $system_id)
 {
     $bugs = Bugs::findFirstById($bugs_id);
     $system = Systems::findFirstById($system_id);
     $form = new BugsForm($bugs);
     $this->view->bugs = $bugs;
     $this->view->system = $system;
     $this->view->page = 'Bugs';
     $this->view->form = $form;
     $this->view->max_number = $this->new_number($system_id);
     if ($this->request->isPost()) {
         $bugs = new Bugs();
         $bugs_id = $this->request->getPost('id');
         $bugs = Bugs::find($activity_id);
         if ($bugs->update($this->request->getPost()) == false) {
             foreach ($bugs_id->getMessages() as $message) {
                 $this->flash->error((string) $message);
             }
         } else {
             $this->flash->success('Edit Activity Success');
             $this->response->redirect('bugs/system/' . $system_id);
         }
     }
 }
Exemplo n.º 3
0
<?php

defined('__bbug') or die;
$list = new Bugs($this->db);
$list->tableHeader();
$list->bblist(0);
Exemplo n.º 4
0
<?php

//ini_set("display_errors" , 1 );
require_once 'class/global.config.php';
require_once 'class/database.inc.php';
require_once 'class/class.bugs.php';
$bugs = new Bugs();
?>
<div id="div_bugs"><?php 
if ($_REQUEST['submit'] == 'submit') {
    echo $bugs->bugTracking('server');
} else {
    echo $bugs->bugTracking('local', 'client');
}
?>
</div>
 function editAction($activity_id, $system_id)
 {
     $activity = Activities::findFirstById($activity_id);
     $system = Systems::findFirstById($system_id);
     $form = new ActivityForm($activity);
     $bugs_id = new Select('bugs_id', Bugs::find(), array('useEmpty' => true));
     $bugs_id->setLabel('Select Bugs');
     $bugs_id->setDefault(array($activity->bugs_id));
     $array = [];
     foreach (Bugs::find(array('system_id = ' . $system_id)) as $bug) {
         if ($bug->modules_id) {
             $modules_name = '[' . $bug->modules->name . '] - ';
         } else {
             $modules_name = '';
         }
         $array[$bug->id] = $modules_name . ' ' . $bug->description;
     }
     $bugs_id->setOptions($array);
     $form->add($bugs_id);
     /*=======  Modules  =======*/
     $modulesId = new Select('modules_id', Modules::find(array('system_id = ' . $system_id)), array('using' => array('id', 'name'), 'useEmpty' => true));
     $modulesId->setLabel('Select Modules');
     $modulesId->setDefault(array($activity->modules_id));
     $form->add($modulesId);
     $this->view->activity = $activity;
     $this->view->system = $system;
     $this->view->page = 'Modules';
     $this->view->form = $form;
     if ($this->request->isPost()) {
         $activities = new Activities();
         $activity_id = $this->request->getPost('id');
         $activities = Activities::find($activity_id);
         if ($activities->update($this->request->getPost()) == false) {
             foreach ($activities->getMessages() as $message) {
                 $this->flash->error((string) $message);
             }
         } else {
             $this->flash->success('Edit Activity Success');
             $this->response->redirect('activity/system/' . $system_id);
         }
     }
 }
 function reDirect($getArr, $object = null)
 {
     $form_creator = new FormCreator($getArr);
     switch ($getArr['mtcode']) {
         case 'BUG':
             $form_creator->formPath = '/templates/maintenance/bugs.php';
             $bug = new Bugs();
             $form_creator->popArr['module'] = $bug->getAlias('module');
             break;
         case 'DVR':
             $form_creator->formPath = '/templates/maintenance/dbversions.php';
             $dbvers = new DbVersions();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $dbvers->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $dbvers->filterdbVersions($getArr['id']);
             }
             break;
         case 'MOD':
             $form_creator->formPath = '/templates/maintenance/modules.php';
             $modls = new Modules();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['version'] = $modls->getVersionList();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $modls->filterModules($getArr['id']);
                 $form_creator->popArr['version'] = $modls->getVersionList();
             }
             break;
         case 'USG':
             $form_creator->formPath = '/templates/maintenance/usergroups.php';
             $usrgrp = new UserGroups();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $usrgrp->filterUserGroups($getArr['id']);
             }
             break;
         case 'VER':
             $form_creator->formPath = '/templates/maintenance/versions.php';
             $vers = new Versions();
             //$form_creator ->popArr['date'] = $vers->getDate();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $vers->getLastRecord();
                 $form_creator->popArr['db'] = $vers->getdbVersionList();
                 $form_creator->popArr['file'] = $vers->getFileVersionList();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $vers->filterVersions($getArr['id']);
                 $form_creator->popArr['db'] = $vers->getdbVersionList();
                 $form_creator->popArr['file'] = $vers->getFileVersionList();
             }
             break;
         case 'FVR':
             $form_creator->formPath = '/templates/maintenance/fileversions.php';
             $filever = new fileVersions();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $filever->getLastRecord();
                 $form_creator->popArr['modlist'] = $filever->getModuleList();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $filever->filterfileVersions($getArr['id']);
                 $form_creator->popArr['modlist'] = $filever->getModuleList();
             }
             break;
         case 'USR':
             $form_creator->formPath = '/templates/maintenance/users.php';
             $user = new Users();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $user->filterUsers($getArr['id']);
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
                 //$form_creator ->popArr['editArr'] = $user->filterChangeUsers($getArr['id']);
             }
             break;
         case 'CPW':
             $form_creator->formPath = '/templates/maintenance/changeusers.php';
             $chuser = new Users();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['emplist'] = $chuser->getEmployeeCodes();
                 //$form_creator ->popArr['uglist'] = $chuser->getUserGroupCodes();
                 $form_creator->popArr['editArr'] = $chuser->filterChangeUsers($getArr['id']);
             }
             break;
         case 'UGR':
             $form_creator->formPath = '/templates/maintenance/AdminMenu.php';
             $urights = new Rights();
             $usergroup = new UserGroups();
             $form_creator->popArr['ugDet'] = $usergroup->filterUserGroups($getArr['id']);
             $form_creator->popArr['modlist'] = $urights->getAllModules();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $urights->filterRights($arr);
             } else {
                 $form_creator->popArr['modlistUnAss'] = $urights->getModuleCodes($getArr['id']);
             }
             $form_creator->popArr['modlistAss'] = $urights->getAssRights($getArr['id']);
             break;
     }
     $form_creator->display();
 }
<?php

require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
$db = Zend_Db::factory('pdo_mysql', array('username' => 'root', 'password' => 'tribal', 'host' => 'localhost', 'dbname' => 'zfunittests'));
$db->getProfiler()->setEnabled(true);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
class Bugs extends Zend_Db_Table_Abstract
{
    protected $_schema = "zfunittests";
    protected $_name = 'bugs';
}
class Products extends Zend_Db_Table_Abstract
{
    protected $_schema = "zfunittests";
    protected $_name = "products";
}
class BugsProducts extends Zend_Db_Table_Abstract
{
    protected $_schema = "zfunittests";
    protected $_name = "bugs_products";
    protected $_referenceMap = array('Bug' => array('columns' => 'bug_id', 'refTableClass' => 'Bugs', 'refColumns' => array('bug_id'), 'onDelete' => self::CASCADE, 'onUpdate' => self::CASCADE), 'Product' => array('columns' => array('product_id'), 'refTableClass' => 'Products', 'refColumns' => array('product_id'), 'onDelete' => self::CASCADE, 'onUpdate' => self::CASCADE));
}
$bugs = new Bugs();
$bug = $bugs->find(1)->current();
$products = $bug->findManyToManyRowset("Products", "BugsProducts");
var_dump($db->getProfiler()->getQueryProfiles());
Exemplo n.º 8
0
if (EMAIL_SYSTEM == 'gmail') {
    $cal = new GCalendar(USER, PASS);
}
$page = new basic_page();
$user = new User();
$page->auth->Checklogin();
$notify = new Notification();
$contact = new Company_Global();
$contact->SetUserID($page->auth->Get_user_id());
$contact->SetUserName($page->auth->Get_user_name());
$news = new News();
$message = new Message();
$ajax = new PHPLiveX();
$user = new User();
$task = new Tasks();
$bugs = new Bugs();
$task->SetUserObject($user);
$task->SetUserID($page->auth->Get_user_id());
$ajax->AjaxifyObjects(array("task", "bugs"));
$page->setPageKeywords('');
$page->setPageDescription('');
$page->setPageTitle("BUG LIST");
$page->setActiveButton('1');
$page->setInnerNav('0');
$page->setImportCss1('main_style.css');
$page->setImportCss2('welcome.css');
$page->setImportCss3('form.css');
$page->SetDynamicCSS_1('main_style.php');
$page->SetDynamicCSS_2('form.php');
$page->SetDynamicCSS_1('main_style.php');
$page->SetDynamicCSS_3('welcome_1.php');
Exemplo n.º 9
0
<?php

$bugsTable = Doctrine_Core::getTable('Bugs');
$bugsTable->find(1234);
$bug = new Bugs();
$bug->summary = "Crashes when I save";
$bug->save();