PHP version 5
Author: Paulo Homem (contact@phalkaline.eu)
Inheritance: extends PhkapaAppModel
コード例 #1
7
 public function run()
 {
     Priority::create(['title' => 'Low']);
     Priority::create(['title' => 'Medium']);
     Priority::create(['title' => 'High']);
     Priority::create(['title' => 'Urgent']);
     Priority::create(['title' => 'Critical']);
 }
コード例 #2
0
ファイル: SubjectController.php プロジェクト: jjsub/samesub
 public function actionAdd()
 {
     global $arr_response;
     $model = new Subject();
     $model->scenario = 'add';
     $_REQUEST['content_type_id'] = ContentType::model()->find('name=:name', array(':name' => $_REQUEST['content_type']))->id;
     $_REQUEST['country_id'] = Country::model()->find('code=:code', array(':code' => $_REQUEST['country_code']))->id;
     $_REQUEST['priority_id'] = Priority::model()->find('name=:name', array(':name' => $_REQUEST['priority']))->id;
     if ($_REQUEST['time']) {
         if (date("l", $_REQUEST['time'])) {
             //if its a valid timestamp
             $_REQUEST['user_position_ymd'] = date("Y", $_REQUEST['time']) . "/" . date("m", $_REQUEST['time']) . "/" . date("d", $_REQUEST['time']);
             $_REQUEST['user_position_hour'] = date("H", $_REQUEST['time']);
             $_REQUEST['user_position_minute'] = date("i", $_REQUEST['time']);
         }
     } else {
         $_REQUEST['user_position_anydatetime'] = 1;
     }
     $model->attributes = $_REQUEST;
     //NOTICE that we are creating a new record, so model its not loaded, ($model->content_type its juest the received $_REQUEST parameter)
     //print_r($model);
     //$model->content_type_id = $content_type->id;
     if ($model->save()) {
         $arr_response['response_message'] = Yii::t('subject', 'Subject successfully saved.');
     } else {
         $arr_response['response_code'] = 409;
         $arr_response['response_message'] = Yii::t('subject', 'Subject could not be saved.');
         $arr_response['response_details'] = $model->getErrors();
     }
 }
コード例 #3
0
 /**
  * Method used to quickly change the ranking of a reminder entry
  * from the administration screen.
  *
  * @access  public
  * @param   integer $pri_id The reminder entry ID
  * @param   string $rank_type Whether we should change the reminder ID down or up (options are 'asc' or 'desc')
  * @return  boolean
  */
 function changeRank($prj_id, $pri_id, $rank_type)
 {
     // check if the current rank is not already the first or last one
     $ranking = Priority::_getRanking($prj_id);
     $ranks = array_values($ranking);
     $ids = array_keys($ranking);
     $last = end($ids);
     $first = reset($ids);
     if ($rank_type == 'asc' && $pri_id == $first || $rank_type == 'desc' && $pri_id == $last) {
         return false;
     }
     if ($rank_type == 'asc') {
         $diff = -1;
     } else {
         $diff = 1;
     }
     $new_rank = $ranking[$pri_id] + $diff;
     if (in_array($new_rank, $ranks)) {
         // switch the rankings here...
         $index = array_search($new_rank, $ranks);
         $replaced_pri_id = $ids[$index];
         $stmt = "UPDATE\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority\n                     SET\n                        pri_rank=" . Misc::escapeInteger($ranking[$pri_id]) . "\n                     WHERE\n                        pri_prj_id=" . Misc::escapeInteger($prj_id) . " AND\n                        pri_id=" . Misc::escapeInteger($replaced_pri_id);
         $GLOBALS["db_api"]->dbh->query($stmt);
     }
     $stmt = "UPDATE\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority\n                 SET\n                    pri_rank=" . Misc::escapeInteger($new_rank) . "\n                 WHERE\n                    pri_prj_id=" . Misc::escapeInteger($prj_id) . " AND\n                    pri_id=" . Misc::escapeInteger($pri_id);
     $GLOBALS["db_api"]->dbh->query($stmt);
     return true;
 }
コード例 #4
0
 public static function LOW()
 {
     if (!Priority::$low) {
         Priority::$low = new Priority('LOW');
     }
     return Priority::$low;
 }
コード例 #5
0
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     /*Retrieve ticket Details */
     $ticket = Ticket::model()->findByPk($id);
     /*Retrieve the names for each ticket */
     $userCreator = User::model()->findBySql("SELECT * from user  WHERE id=:id", array(":id" => $ticket->creator_user_id));
     $userAssign = User::model()->findBySql("SELECT * from user  WHERE id=:id", array(":id" => $ticket->assign_user_id));
     $domainName = Domain::model()->findBySql("SELECT * from domain  WHERE id=:id", array(":id" => $ticket->domain_id));
     $priority = Priority::model()->findBySql("SELECT * from priority WHERE id=:id", array(":id" => $ticket->priority_id));
     $tier = UserDomain::model()->findBySql("SELECT * from user_domain WHERE user_id =:id and domain_id =:id2", array(":id" => $ticket->assign_user_id, ":id2" => $ticket->domain_id));
     $subdomainName = null;
     if ($ticket->subdomain_id != null) {
         $subdomainName = Subdomain::model()->findBySql("SELECT * from subdomain  WHERE id=:id", array(":id" => $ticket->subdomain_id));
         $tier = UserDomain::model()->findBySql("SELECT * from user_domain WHERE user_id =:id and domain_id =:id2 and subdomain_id =:id3", array(":id" => $ticket->assign_user_id, ":id2" => $ticket->domain_id, ":id3" => $ticket->subdomain_id));
     }
     $this->render('view', array('model' => $this->loadModel($id), 'userCreator' => $userCreator, 'userAssign' => $userAssign, 'domainName' => $domainName, 'subdomainName' => $subdomainName, 'priority' => $priority, 'tier' => $tier));
     if (!Yii::app()->request->isPostRequest && !Yii::app()->request->isAjaxRequest) {
         $curentUserID = User::getCurrentUserId();
         if ($ticket->creator_user_id == $curentUserID) {
             TicketEvents::recordEvent(EventType::Event_Opened_By_Owner, $ticket->id, NULL, NULL, NULL);
         } else {
             TicketEvents::recordEvent(EventType::Event_Opened_By_Mentor, $ticket->id, NULL, NULL, NULL);
         }
     }
 }
コード例 #6
0
 public function testOne()
 {
     $context = Context::builder()->place('DE')->priority(Priority::REALTIME())->build();
     $this->assertEquals('DE', $context->getPlace());
     $this->assertEquals(Priority::REALTIME(), $context->getPriority());
     $this->assertEquals(array(), $context->getProperties());
 }
コード例 #7
0
 public function testOne()
 {
     $context = Context::builder()->apiKey('my-api-key')->geo('DE')->priority(Priority::REALTIME())->build();
     $this->assertEquals('my-api-key', $context->getApiKey());
     $this->assertEquals('DE', $context->getGeo());
     $this->assertEquals(Priority::REALTIME(), $context->getPriority());
     $this->assertEquals(array(), $context->getProperties());
 }
コード例 #8
0
 public function testIfPriorityExists()
 {
     $this->assertTrue(Priority::has(-2));
     $this->assertTrue(Priority::has(0));
     $this->assertTrue(Priority::has(1));
     $this->assertFalse(Priority::has(-5));
     $this->assertFalse(Priority::has(10));
 }
コード例 #9
0
ファイル: DatabaseSeeder.php プロジェクト: noikiy/laradesk
 public function run()
 {
     DB::table('priorities')->delete();
     $stamp = date('Y-m-d H:i:s');
     $priorities_array = array(array('priorities_name' => 'Low', 'created_at' => $stamp, 'updated_at' => $stamp), array('priorities_name' => 'Medium', 'created_at' => $stamp, 'updated_at' => $stamp), array('priorities_name' => 'High', 'created_at' => $stamp, 'updated_at' => $stamp), array('priorities_name' => 'Urgent', 'created_at' => $stamp, 'updated_at' => $stamp));
     foreach ($priorities_array as $added_row) {
         Priority::create($added_row);
     }
 }
コード例 #10
0
ファイル: Priority.php プロジェクト: aftavwani/Master
 public function getPriorityParent($data)
 {
     if ($data->p_parent != 0) {
         $ret = Priority::find(array('condition' => 'p_id=' . $data->p_parent));
         return $ret->p_title;
     } else {
         return 'N/A';
     }
 }
コード例 #11
0
ファイル: Priority.php プロジェクト: terrygl/SimpleLance
 public function getPriorities()
 {
     $allPriorities = Priority::all();
     $priorities = [];
     foreach ($allPriorities as $thisPriority) {
         $priorities[$thisPriority->id] = $thisPriority->title;
     }
     return $priorities;
 }
コード例 #12
0
ファイル: TicketsController.php プロジェクト: noikiy/laradesk
 public function __construct(Ticket $tickets)
 {
     $this->tickets = $tickets;
     $this->beforeFilter('staff');
     // Store attributes array to be used in the functions below.
     $this->attributes = ['staff_users_list' => User::lists('users_username', 'users_id'), 'support_users_list' => User::lists('users_username', 'users_id'), 'categories_list' => Category::lists('categories_name', 'categories_id'), 'priorities_list' => Priority::lists('priorities_name', 'priorities_id'), 'statuses_list' => Status::lists('statuses_name', 'statuses_id')];
     // Add in an 'unassigned' item with an index of 0 to the support users list.
     // This is so we can display this in the view without having to have a database entry for 'unassigned';
     $this->attributes['support_users_list'][0] = 'unassigned';
     // Get current logged in user's auth level.
     $this->user_auth_level = Auth::user()->get_userlevel();
     // Check if current logged in user is Support or Admin user.
     $this->support_check = Auth::user()->isSupport();
 }
コード例 #13
0
ファイル: LeadController.php プロジェクト: aftavwani/Master
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Lead();
     $result = new User();
     $res = User::Model()->findallByattributes(array('superuser' => 2));
     $leaduser = new LeadUsers();
     $prop = Priority::Model()->findall();
     $rem = Reminders::Model()->findall();
     if (isset($_POST['Lead'])) {
         /* $model->reminder_time=$_POST['Lead']['reminder_time'].':'.$_POST['Lead']['sec']; */
         $model->status = 1;
         $model->min_size = $_POST['Lead']['min_size'];
         $model->max_size = $_POST['Lead']['max_size'];
         $model->retailer_webiste = $_POST['Lead']['retailer_webiste'];
         $model->broker_firstname = $_POST['Lead']['broker_firstname'];
         $model->broker_lastname = $_POST['Lead']['broker_lastname'];
         $model->broker_territory = $_POST['Lead']['broker_territory'];
         $model->broker_company = $_POST['Lead']['broker_company'];
         /* 		$model->broker_phone_no= $_POST['broker_phone_no'];
         			$model->broker_cell_no= $_POST['broker_cell_no'];
         			$model->broker_email= $_POST['broker_email'];  */
         $model->linked_username = $_POST['Lead']['linked_username'];
         $model->enquiry_date = $_POST['enquiry_date'];
         $model->create_at = date('Y-m-d-h:i:sa');
         $model->country = $_POST['country'];
         /* 	$model->reminder_date=$_POST['reminder_date']; */
         $model->user_id = Yii::app()->user->id;
         $model->attributes = $_POST['Lead'];
         /* 	echo "<pre>"; print_r(array($model->attributes,$_POST));  */
         if ($model->save()) {
             /* if(isset($_POST['reminder_date'])){
             			$Last_id = $model->id; 
             			$status = 1;
             			Yii::app()->db->createCommand("INSERT INTO `tbl_reminders`(`lead_id`,`date`,`time`,`msg`,`status` ) VALUES ('".$Last_id."', '".$_POST['reminder_date']."','".$_POST['Lead']['reminder_time'].":".$_POST['Lead']['sec']."','".$_POST['Lead']['message']."','".$status."')"  )->execute(); } */
             $this->redirect(array('admin'));
         }
     }
     $this->render('create', array('model' => $model, 'models' => $res, 'props' => $prop));
 }
コード例 #14
0
ファイル: row_old.php プロジェクト: Dvionst/vvfy
        ?>
%</option>
					<?php 
        $a = $a + 10;
    }
    ?>
	
				</select>
			</div>
		</div>
	</td>
	<td >
		<select class="combo-p" style="display:inline">
			<?php 
    $priority = Project::model()->findByPk($de[id])->priority;
    foreach (Priority::model()->findAll() as $d) {
        ?>
			<option <?php 
        if ($priority == $d[id]) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo $d[id];
        ?>
"><?php 
        echo $d[name];
        ?>
</option>
			<?php 
    }
コード例 #15
0
ファイル: new.php プロジェクト: korusdipl/eventum
        if (count($item) == 1) {
            $email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($item[0]), $item[0]);
            $tpl->assign(array('issue_summary' => $email_details['sup_subject'], 'issue_description' => $email_details['seb_body']));
            // also auto pre-fill the customer contact text fields
            if (CRM::hasCustomerIntegration($prj_id)) {
                $sender_email = Mail_Helper::getEmailAddress($email_details['sup_from']);
                try {
                    $contact = $crm->getContactByEmail($sender_email);
                    $tpl->assign('contact_details', $contact->getDetails());
                } catch (CRMException $e) {
                }
            }
        }
    }
}
$tpl->assign(array('cats' => Category::getAssocList($prj_id), 'priorities' => Priority::getAssocList($prj_id), 'severities' => Severity::getList($prj_id), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'releases' => Release::getAssocList($prj_id), 'custom_fields' => Custom_Field::getListByProject($prj_id, 'report_form'), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'max_attachment_bytes' => Attachment::getMaxAttachmentSize(true), 'field_display_settings' => Project::getFieldDisplaySettings($prj_id), 'groups' => Group::getAssocList($prj_id), 'products' => Product::getList(false)));
$prefs = Prefs::get($usr_id);
$tpl->assign('user_prefs', $prefs);
$tpl->assign('zones', Date_Helper::getTimezoneList());
if (Auth::getCurrentRole() == User::getRoleID('Customer')) {
    $crm = CRM::getInstance(Auth::getCurrentProject());
    $customer_contact_id = User::getCustomerContactID($usr_id);
    $contact = $crm->getContact($customer_contact_id);
    $customer_id = Auth::getCurrentCustomerID();
    $customer = $crm->getCustomer($customer_id);
    // TODOCRM: Pull contacts via ajax when user selects contract
    $tpl->assign(array('customer_id' => $customer_id, 'contact_id' => $customer_contact_id, 'customer' => $customer, 'contact' => $contact));
}
$clone_iss_id = isset($_GET['clone_iss_id']) ? (int) $_GET['clone_iss_id'] : null;
if ($clone_iss_id && Access::canCloneIssue($clone_iss_id, $usr_id)) {
    $tpl->assign(Issue::getCloneIssueTemplateVariables($clone_iss_id));
コード例 #16
0
ファイル: class.issue.php プロジェクト: dabielkabuto/eventum
 /**
  * Method used to bulk update a list of issues
  *
  * @return  boolean
  */
 public static function bulkUpdate()
 {
     // check if user performing this chance has the proper role
     if (Auth::getCurrentRole() < User::ROLE_MANAGER) {
         return -1;
     }
     $items = (array) $_POST['item'];
     $new_status_id = (int) $_POST['status'];
     $new_release_id = (int) $_POST['release'];
     $new_priority_id = (int) $_POST['priority'];
     $new_category_id = (int) $_POST['category'];
     foreach ($items as $issue_id) {
         $issue_id = (int) $issue_id;
         if (!self::canAccess($issue_id, Auth::getUserID())) {
             continue;
         }
         if (self::getProjectID($issue_id) != Auth::getCurrentProject()) {
             // make sure issue is not in another project
             continue;
         }
         $issue_details = self::getDetails($issue_id);
         $updated_fields = array();
         // update assignment
         if (count(@$_POST['users']) > 0) {
             $users = (array) $_POST['users'];
             // get who this issue is currently assigned too
             $stmt = 'SELECT
                         isu_usr_id,
                         usr_full_name
                      FROM
                         {{%issue_user}},
                         {{%user}}
                      WHERE
                         isu_usr_id = usr_id AND
                         isu_iss_id = ?';
             try {
                 $current_assignees = DB_Helper::getInstance()->getPair($stmt, array($issue_id));
             } catch (DbException $e) {
                 return -1;
             }
             foreach ($current_assignees as $usr_id => $usr_name) {
                 if (!in_array($usr_id, $users)) {
                     self::deleteUserAssociation($issue_id, $usr_id, false);
                 }
             }
             $new_user_names = array();
             $new_assignees = array();
             foreach ($users as $usr_id) {
                 $usr_id = (int) $usr_id;
                 $new_user_names[$usr_id] = User::getFullName($usr_id);
                 // check if the issue is already assigned to this person
                 $stmt = 'SELECT
                             COUNT(*) AS total
                          FROM
                             {{%issue_user}}
                          WHERE
                             isu_iss_id=? AND
                             isu_usr_id=?';
                 $total = DB_Helper::getInstance()->getOne($stmt, array($issue_id, $usr_id));
                 if ($total > 0) {
                     continue;
                 } else {
                     $new_assignees[] = $usr_id;
                     // add the assignment
                     self::addUserAssociation(Auth::getUserID(), $issue_id, $usr_id, false);
                     Notification::subscribeUser(Auth::getUserID(), $issue_id, $usr_id, Notification::getAllActions());
                 }
             }
             $prj_id = Auth::getCurrentProject();
             $usr_ids = self::getAssignedUserIDs($issue_id);
             Workflow::handleAssignmentChange($prj_id, $issue_id, Auth::getUserID(), $issue_details, $usr_ids, false);
             Notification::notifyNewAssignment($new_assignees, $issue_id);
             $updated_fields['Assignment'] = History::formatChanges(implode(', ', $current_assignees), implode(', ', $new_user_names));
         }
         // update status
         if ($new_status_id) {
             $old_status_id = self::getStatusID($issue_id);
             $res = self::setStatus($issue_id, $new_status_id, false);
             if ($res == 1) {
                 $updated_fields['Status'] = History::formatChanges(Status::getStatusTitle($old_status_id), Status::getStatusTitle($new_status_id));
             }
         }
         // update release
         if ($new_release_id) {
             $old_release_id = self::getRelease($issue_id);
             $res = self::setRelease($issue_id, $new_release_id);
             if ($res == 1) {
                 $updated_fields['Release'] = History::formatChanges(Release::getTitle($old_release_id), Release::getTitle($new_release_id));
             }
         }
         // update priority
         if ($new_priority_id) {
             $old_priority_id = self::getPriority($issue_id);
             $res = self::setPriority($issue_id, $new_priority_id);
             if ($res == 1) {
                 $updated_fields['Priority'] = History::formatChanges(Priority::getTitle($old_priority_id), Priority::getTitle($new_priority_id));
             }
         }
         // update category
         if ($new_category_id) {
             $old_category_id = self::getCategory($issue_id);
             $res = self::setCategory($issue_id, $new_category_id);
             if ($res == 1) {
                 $updated_fields['Category'] = History::formatChanges(Category::getTitle($old_category_id), Category::getTitle($new_category_id));
             }
         }
         if (count($updated_fields) > 0) {
             // log the changes
             $changes = '';
             $k = 0;
             foreach ($updated_fields as $key => $value) {
                 if ($k > 0) {
                     $changes .= '; ';
                 }
                 $changes .= "{$key}: {$value}";
                 $k++;
             }
             $usr_id = Auth::getUserID();
             History::add($issue_id, $usr_id, 'issue_bulk_updated', 'Issue updated ({changes}) by {user}', array('changes' => $changes, 'user' => User::getFullName(Auth::getUserID())));
         }
         // close if request
         if (isset($_REQUEST['closed_status']) && !empty($_REQUEST['closed_status'])) {
             self::close(Auth::getUserID(), $issue_id, true, 0, $_REQUEST['closed_status'], $_REQUEST['closed_message'], $_REQUEST['notification_list']);
         }
     }
     return true;
 }
コード例 #17
0
ファイル: manageContacts.inc.php プロジェクト: kelen303/iEMS
 $cvTypeID = $_GET['CvType'] + 0;
 $cvSubtypeID = $_GET['CvSubtype'] + 0;
 $contactValue = $_GET['contactValue'];
 $contactProfileObjectID = $_GET['profileObjectId'] + 0;
 $contactUseID = $_GET['contactUseId'] + 0;
 $priorityID = $_GET['priority'] + 0;
 $dpoEmail = $_GET['dpoEmail'] + 0;
 $dptEmail = $_GET['dptEmail'] + 0;
 $dpoPhone = $_GET['dpoPhone'] + 0;
 $dptPhone = $_GET['dptPhone'] + 0;
 // We have the particulars.  We need to verify that the owner name is new.  If
 // it is not, we will retrieve the OwnerNameID from the database to be used with
 // the contact value.
 $contactManager = new ContactManager($domainID, $userID);
 $cvTypes = $contactManager->GetContactValueTypes();
 $priority = new Priority();
 $priority->Get($priorityID);
 /*
 echo '$dpoEmail=\'',$dpoEmail,"'<br>\n";
 echo '$cvTypes[$cvTypeID]->name()=\'', $cvTypes[$cvTypeID]->name(), "'<br>\n";
 echo '$priority->level()=\'', $priority->level(), "'<br>\n";
 */
 // mcb 2010.06.03
 // need to identify to which profile the error message belongs.
 if ($dpoEmail && $cvTypes[$cvTypeID]->name() == "email" && $priority->level() == 1) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a primary email contact to this profile before lowering the priority of the existing primary email contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } elseif ($dptEmail && $cvTypes[$cvTypeID]->name() == "email" && $priority->level() == 2) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a secondary email contact to this profile before lowering the priority of the existing secondary email contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } elseif ($dpoPhone && $cvTypes[$cvTypeID]->name() == "phone" && $priority->level() == 1) {
コード例 #18
0
ファイル: anonymous.php プロジェクト: dabielkabuto/eventum
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/anonymous.tpl.html');
Auth::checkAuthentication();
@($prj_id = $_POST['prj_id'] ? $_POST['prj_id'] : $_GET['prj_id']);
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'update') {
    $res = Project::updateAnonymousPost($prj_id);
    $tpl->assign('result', $res);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the information was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the information.'), Misc::MSG_ERROR)));
}
// load the form fields
$tpl->assign('project', Project::getDetails($prj_id));
$tpl->assign('cats', Category::getAssocList($prj_id));
$tpl->assign('priorities', Priority::getList($prj_id));
$tpl->assign('users', Project::getUserAssocList($prj_id, 'active'));
$tpl->assign('options', Project::getAnonymousPostOptions($prj_id));
$tpl->assign('prj_id', $prj_id);
$tpl->displayTemplate();
コード例 #19
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     return View::make('tasks.create')->with('task', Task::findOrFail($id))->with('title', 'Edit Task')->with('method', 'PUT')->with('url', 'tasks/' . $id)->with('priorities', Priority::lists('priority_name', 'id'))->with('statuses', Status::lists('status_name', 'id'));
 }
コード例 #20
0
ファイル: class.config.php プロジェクト: gizur/osticket
 function getDefaultPriority()
 {
     if (!isset($this->defaultPriority)) {
         $this->defaultPriority = Priority::lookup($this->getDefaultPriorityId());
     }
     return $this->defaultPriority;
 }
コード例 #21
0
ファイル: class.forms.php プロジェクト: ed00m/osTicket-1.8
 function to_php($value, $id)
 {
     return Priority::lookup($id);
 }
コード例 #22
0
 function lookup($id)
 {
     return $id && is_numeric($id) && ($p = new Priority($id)) && $p->getId() == $id ? $p : null;
 }
コード例 #23
0
             list($hr,$min)=explode(':',$info['time']);
             echo Misc::timeDropdown($hr,$min,'time');
         ?>
         &nbsp;<font class="error">&nbsp;<?=$errors['duedate']?>&nbsp;<?php echo $errors['time']; ?></font>
         <em>Time is based on your time zone (GM <?php echo $thisstaff->getTZoffset(); ?>)</em>
     </td>
 </tr>
 <tr>
     <td width="160">
         Priority:
     </td>
     <td>
         <select name="priorityId">
             <option value="0" selected >&mdash; System Default &mdash;</option>
             <?php
             if($priorities=Priority::getPriorities()) {
                 foreach($priorities as $id =>$name) {
                     echo sprintf('<option value="%d" %s>%s</option>',
                             $id, ($info['priorityId']==$id)?'selected="selected"':'',$name);
                 }
             }
             ?>
         </select>
         &nbsp;<font class="error">&nbsp;<?=$errors['priorityId']?></font>
     </td>
 </tr>
 <?php
 if($thisstaff->canAssignTickets()) { ?>
 <tr>
     <td width="160">Assign To:</td>
     <td>
コード例 #24
0
ファイル: open.inc.php プロジェクト: nicolap/osTicket-1.7
if ($cfg->allowOnlineAttachments() && !$cfg->allowAttachmentsOnlogin() || $cfg->allowAttachmentsOnlogin() && ($thisclient && $thisclient->isValid())) {
    ?>
     <div>
        <label for="attachments">Attachments:</label>
        <span id="uploads"></span>
        <input type="file" class="multifile" name="attachments[]" id="attachments" size="30" value="" />
        <font class="error">&nbsp;<?php 
    echo $errors['attachments'];
    ?>
</font>
    </div>                                                                
    <?php 
}
?>
    <?php 
if ($cfg->allowPriorityChange() && ($priorities = Priority::getPriorities())) {
    ?>
    <div>
        <label for="priority">Ticket Priority:</label>
        <select id="priority" name="priorityId">
            <?php 
    if (!$info['priorityId']) {
        $info['priorityId'] = $cfg->getDefaultPriorityId();
    }
    //System default.
    foreach ($priorities as $id => $name) {
        echo sprintf('<option value="%d" %s>%s</option>', $id, $info['priorityId'] == $id ? 'selected="selected"' : '', $name);
    }
    ?>

                
コード例 #25
0
ファイル: class.forms.php プロジェクト: gizur/osticket
 function to_php($value, $id = false)
 {
     if (is_array($id)) {
         reset($id);
         $id = key($id);
     } elseif ($id === false) {
         $id = $value;
     }
     if ($id) {
         return Priority::lookup($id);
     }
 }
コード例 #26
0
ファイル: Priority.php プロジェクト: WorkAnyWare/IPFO-PHP
 public static function fromNumber($number)
 {
     $priority = new Priority();
     $priority->setNumber($number);
     return $priority;
 }
コード例 #27
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Priority the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Priority::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
コード例 #28
0
ファイル: Queue.php プロジェクト: openeyes/openeyes
 /**
  * Function to return a list of the fields that we are expecting an assignment form to contain for this queue.
  *
  * @return array(array('id' => string, 'required' => boolean, 'choices' => array(), 'label' => string, 'type' => string))
  */
 public function getFormFields()
 {
     $flds = array();
     // priority and notes are reserved fields and so get additional _ prefix for the field name
     if ($this->is_initial) {
         $flds[] = array('id' => '_priority', 'form_name' => self::$FIELD_PREFIX . '_priority', 'required' => $this->getQueueSet()->allow_null_priority ? false : true, 'choices' => \CHtml::listData(Priority::model()->findAll(), 'id', 'name'), 'label' => 'Priority');
     }
     $flds[] = array('id' => '_notes', 'form_name' => self::$FIELD_PREFIX . '_notes', 'required' => false, 'type' => 'textarea', 'label' => 'Notes');
     return array_merge($flds, $this->getAssignmentFieldDefinitions());
 }
コード例 #29
0
ファイル: searchbar.php プロジェクト: juliogallardo1326/proc
// | 59 Temple Place - Suite 330                                          |
// | Boston, MA 02111-1307, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.searchbar.php 1.3 03/09/26 02:06:54-00:00 jpradomaia $
//
include_once "config.inc.php";
include_once APP_INC_PATH . "db_access.php";
include_once APP_INC_PATH . "class.template.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.category.php";
include_once APP_INC_PATH . "class.priority.php";
include_once APP_INC_PATH . "class.misc.php";
include_once APP_INC_PATH . "class.release.php";
include_once APP_INC_PATH . "class.project.php";
include_once APP_INC_PATH . "class.filter.php";
include_once APP_INC_PATH . "class.status.php";
$tpl = new Template_API();
$tpl->setTemplate("searchbar.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$prj_id = Auth::getCurrentProject();
$tpl->assign("priorities", Priority::getList($prj_id));
$tpl->assign("status", Status::getAssocStatusList($prj_id));
$tpl->assign("users", Project::getUserAssocList($prj_id));
$tpl->assign("categories", Category::getAssocList($prj_id));
$tpl->assign("custom", Filter::getListing($prj_id));
$options = Issue::saveSearchParams();
$tpl->assign("options", $options);
$tpl->displayTemplate();
コード例 #30
0
ファイル: timeboard.php プロジェクト: jjsub/samesub
}

///function bind_click_positions(){
  $(".set_position").live('click', function(){
	var id = $(this).html();
	$.fn.yiiGridView.update("subject-grid", {url:"",data:{"id":id, "day":$("#Subject_Position_day_"+id).val()
	,"hour":$("#Subject_Position_hour_"+id).val(), "minute":$("#Subject_Position_minute_"+id).val()   } });
  });
//}

//Auto update the grid timeboard every subject change interval

function refresh_timeboard()
{  
  $.fn.yiiGridView.update("subject-grid", {url:""});
  //self.setInterval("refresh_timeboard()",<?php 
echo Yii::app()->params['subject_interval'] * 60;
?>
000);
}


</script>


<p>Legend: <span class="row_red">RED</span> => Live NOW</p>
<?php 
$dataProvider = $model->search('t.position ASC');
$dataProvider->pagination->pageSize = 30;
$this->widget('zii.widgets.grid.CGridView', array('id' => 'subject-grid', 'dataProvider' => $dataProvider, 'filter' => $model, 'rowCssClass' => 'something', 'columns' => array(array('name' => 'id', 'id' => $live_subject["subject_id"] . '_' . $live_subject["subject_id_2"], 'type' => 'html', 'value' => '"<div class=\\"set_position\\" onClick=\\"\\">".$data->id."</div>"', 'headerHtmlOptions' => array('width' => '25px'), 'cssClassExpression' => '($data->id == substr($this->id, 0, strpos($this->id, "_"))) ? row_red : something', 'sortable' => true), array('name' => 'position', 'header' => 'Position Da/Ho/Mi', 'filter' => '', 'type' => 'raw', 'value' => 'CHtml::DropDownList("Subject_Position_day_".$data->id, date("j",$data->position), SiteLibrary::get_time_intervals("day")) . CHtml::DropDownList("Subject_Position_hour_".$data->id, date("G",$data->position), SiteLibrary::get_time_intervals("hour")). CHtml::DropDownList("Subject_Position_minute_".$data->id, date("i",$data->position), SiteLibrary::get_time_intervals("minute"))', 'headerHtmlOptions' => array('width' => '175px'), 'sortable' => true), array('name' => 'user_position', 'header' => 'User Position', 'type' => 'raw', 'value' => '($data->user_position) ? date("d",$data->user_position) . " " . date("H",$data->user_position) ." ". date("i",$data->user_position) : "--  --  --"'), array('name' => 'manager_position', 'header' => 'Manager Position', 'type' => 'raw', 'value' => '($data->manager_position) ? date("d",$data->manager_position) . " " . date("H",$data->manager_position) ." ". date("i",$data->manager_position) : "--  --  --"'), array('name' => 'user_id', 'type' => 'html', 'value' => 'CHtml::link(User::model()->findByPk($data->user_id)->username,Yii::app()->getRequest()->getBaseUrl(true)."/mysub/".User::model()->findByPk($data->user_id)->username)', 'filter' => '', 'headerHtmlOptions' => array('width' => '25px'), 'sortable' => true), array('name' => 'country_id', 'value' => '$data->country->name', 'filter' => CHtml::listData(Country::model()->findAll(), 'id', 'name'), 'sortable' => true), array('name' => 'category', 'filter' => CHtml::listData(Yii::app()->db->createCommand()->select('name')->from('subject_category')->queryAll(), 'name', 'name'), 'sortable' => true), array('name' => 'title', 'headerHtmlOptions' => array('width' => '200px'), 'type' => 'html', 'value' => 'CHtml::link($data->title,Yii::app()->getRequest()->getBaseUrl(true)."/sub/".$data->urn)'), array('name' => 'priority_id', 'value' => '$data->priority_type->name', 'headerHtmlOptions' => array('width' => '50px'), 'filter' => CHtml::listData(Priority::model()->findAll(), 'id', 'name'), 'sortable' => true), array('name' => 'content_type_id', 'value' => '$data->content_type->fullname', 'headerHtmlOptions' => array('width' => '50px'), 'filter' => CHtml::listData(ContentType::model()->findAll(), 'id', 'name'), 'sortable' => true), array('name' => 'time_submitted', 'value' => 'date("Y/m/d H:i", $data->time_submitted)', 'headerHtmlOptions' => array('width' => '100px'), 'sortable' => true)), 'enablePagination' => true));