public function getMembersGroup() { use_class('minierp_users'); $class_mu = new minierp_users(); if (!is_null($this->id)) { $q = "SELECT * FROM minierp_groups_members WHERE minierp_groups_id={$this->id}"; $r = tep_db_query($q); if (tep_db_num_rows($r) > 0) { while ($row = tep_db_fetch_array($r)) { $users_id[] = $row['minierp_users_id']; } $users_ids = implode(",", $users_id); $members = $class_mu->retrieveList('id IN (' . $users_ids . ')'); return $members; } } return false; }
public function setDetail($name = '', $team = '', $category = '', $priority = '', $date_added = '', $owner_id = '', $owner_name = '', $owner_image = '', $owner_location = '', $pic = '', $pic_name = '', $pic_image = '', $description = '', $goals = '', $eta = '', $deadline = '', $check_date = '', $comments = '', $followers = '', $attachments = '', $likes = '', $kickoff_date = '', $relevancy_stars = 0, $is_sensitive = 0, $description_technical = '', $attachments_kickoff = '') { $module_name = 'Improvement'; $module_item_category = self::getTeamCategories($team, $category); $module_item_link = 'open=improvement&id=' . $this->id; //GRAB OWNER IMAGE if ($owner_id > 0) { use_class('minierp_users'); $class_mu = new minierp_users(); $user_owner = $class_mu->retrieveList("id = '{$owner_id}'"); $owner_image = $user_owner[0]['users_image']; } //GRAB PIC IMAGE if ($pic > 0) { if (!is_object($class_mu)) { use_class('minierp_users'); $class_mu = new minierp_users(); } $user_pic = $class_mu->retrieveList("id = '{$pic}'"); $pic_image = $user_pic[0]['users_image']; } $this->name = $name; $this->team = $team; $this->category = $category; $this->priority = $priority; $this->date_added = $date_added; $this->owner_id = $owner_id; $this->owner_name = $owner_name; $this->owner_image = is_file(DIR_WS_IMAGES . $owner_image) ? $owner_image : 'user-default.png'; $this->owner_location = $owner_location; $this->pic = $pic; $this->pic_name = $pic_name; $this->pic_image = is_file(DIR_WS_IMAGES . $pic_image) ? $pic_image : 'user-default.png'; $this->description = $description; $this->description_technical = $description_technical; $this->goals = $goals; $this->eta = $eta; $this->deadline = $deadline; $this->check_date = $check_date; $this->comments = new comments('improvements', 'comments', 'improvements_id', $this->id, $comments, '', '', $module_name, $module_item_category, $name, $module_item_link); $this->followers = new followers('improvements', 'followers', 'improvements_id', $this->id, $this->owner_id, $followers, $module_name, $module_item_category, $name, $module_item_link); $this->attachments = new attachments('improvements', 'attachments', 'improvements_id', $this->id, 'improvements', $attachments); $this->attachments_kickoff = new attachments('improvements', 'attachments_kickoff', 'improvements_id', $this->id, 'improvements', $attachments_kickoff); $this->likes = new likes('improvements', 'likes', 'improvements_id', $this->id, $this->owner_id, $likes, $module_name, $module_item_category, $name, $module_item_link); $this->kickoff_date = $kickoff_date; $this->relevancy_stars = $relevancy_stars; $this->is_sensitive = $is_sensitive; }
unset($cat_options[$ck]); } } $categories .= '<select class="w300 teamcats" id="teamcat-' . $dk . '" style="display:none;"' . ($category_disabled ? ' disabled="disabled"' : '') . '>' . loadComboListFromArray($cat_options, null, $def, false) . '</select>'; } $etas = improvement::getETA(); $users_filter = "status=1"; if ($improvement->owner_id > 0) { $users_filter .= " OR id={$improvement->owner_id}"; } if ($improvement->pic > 0) { $users_filter .= " OR id={$improvement->pic}"; } $users = array(); $users[0] = 'Unset'; $users_data = $class_mu->retrieveList($users_filter, "username"); foreach ($users_data as $ud) { $users[$ud['id']] = $ud['username']; } if ($improvement->team != '1') { if ($improvement->status == '4' && $improvement->owner_id == $session_userinfo['id']) { $messagebox->add('Hi ' . ucfirst($session_userinfo['username']) . ', this MIMS is currently in Testing Phase. <strong>Have you shared' . ' it in Manobo Wall?</strong><br />If you still have your <em>need' . ' feedback</em> notification, close it using the <em>Close</em>' . ' button below MIMS Comments,<br />otherwise please ignore this message, thank you. '); } if ($improvement->status == '5' && $improvement->owner_id == $session_userinfo['id']) { $messagebox->add('<strong>Hi ' . ucfirst($session_userinfo['username']) . ', your confirmation is required by this MIMS!</strong><br /><br />' . 'Please add a new comment to confirm to PIC (' . $improvement->pic_name . ') that:<br />1) MIMS can be closed or <br />' . '2) you need more time for testing or<br />' . '3) you have other feedback<br /><br />' . 'Please ignore this message if you have added such comment, thank you. '); } } if ($improvement->team == '1') { $next_status_rule = array('1' => '2', '2' => '7', '7' => '3', '3' => '4', '4' => '6', '8' => '9'); } else { $next_status_rule = array('1' => '2', '2' => '7', '7' => '3', '3' => '4');
private function setDetail($jng_sp_id = '', $name = '', $create_date = '', $create_by = '', $status = '', $booking_id = '', $depot_orders_id = '', $elements_sourcing = '', $jng_sp_orders_id = '', $comments = '', $followers = '', $elements_orders = '') { $module_name = 'Preorder'; $module_item_category = ''; $module_item_link = 'open=sp-preorder&id=' . $this->id; //GRAB OWNER IMAGE if ($create_by != '') { use_class('minierp_users'); $class_mu = new minierp_users(); $user_owner = $class_mu->retrieveList("username='******'"); $create_by_image = $user_owner[0]['users_image']; $create_by_id = $user_owner[0]['id']; } else { $create_by_image = ''; } $this->jng_sp_id = $jng_sp_id; $this->name = $name; $this->create_date = $create_date; $this->create_by = $create_by; $this->create_by_id = $create_by_id; $this->create_by_image = $create_by_image; $this->status = $status; $this->booking_id = $booking_id; $this->depot_orders_id = $depot_orders_id == '' ? array() : unserialize($depot_orders_id); $this->elements_sourcing = $elements_sourcing == '' ? array() : unserialize($elements_sourcing); $this->jng_sp_orders_id = $jng_sp_orders_id == '' ? array() : unserialize($jng_sp_orders_id); $this->elements_orders = $elements_orders == '' ? array() : unserialize($elements_orders); $this->comments = new comments('jng_sp_preorders', 'comments', 'jng_sp_preorders_id', $this->id, $comments, '', '', $module_name, $module_item_category, $name, $module_item_link); $this->followers = new followers('jng_sp_preorders', 'followers', 'jng_sp_preorders_id', $this->id, $this->create_by_id, $followers, $module_name, $module_item_category, $name, $module_item_link); $this->setItems(); }
<?php ##################################### # Author : D3W4 & SAHAT # # Created : Aug 3, 2012 11:50:56 AM # ##################################### use_class('minierp_users'); use_class('notifications'); $class_mu = new minierp_users(); $class_n = new notifications(); //SUBMIT ACTION if (isset($_POST['me_action'])) { if ($_POST['me_action'] == 'LOADUSERS') { $min_time_user_idle = 5 * 60; $min_time_user_offline = 60 * 60; $users_list = $class_mu->retrieveList("status=1", "username"); $users = array(); $u = array(); $u['img'] = 'Image'; $u['name'] = 'Username and Email Address'; $u['o'] = 'Manobo<br/>Online Status'; $u['e'] = 'Last Access<br/>Time Manobo'; $u['a'] = 'Skype ID<br/>'; $u['need_feed tac'] = 'Open<br/>Feedback'; $table_users[] = $u; foreach ($users_list as $row) { $users[] = $row['id'] . "|" . $row['skype_id']; $manobo_online_status_class = "notice"; switch ($row['is_login_manobo']) { case 0: $manobo_online_status = "is-offline";
/** * Set object parameters * @param String $date * @param String $name * @param Int $status * @param String $create_by */ private function setDetail($date = '', $name = '', $status = '', $create_by = '') { //GRAB OWNER IMAGE if ($create_by > 0) { use_class('minierp_users'); $class_mu = new minierp_users(); $user_owner = $class_mu->retrieveList("id={$create_by}"); $create_by_image = $user_owner[0]['users_image']; } else { $create_by_image = ''; } $this->date = $date; $this->name = $name; $this->status = $status; $this->create_by = $create_by; $this->create_by_image = $create_by_image; $this->setItems(); }
function drawLikes($div_style = '') { global $session_userinfo; $content = '<div id="likers" class="boxer"' . ($div_style != '' ? ' style="' . $div_style . '"' : '') . '><table border="0" cellpadding="0" cellspacing="0"><tr>'; $content .= '<td><div class="icon-likes"> </div></td>'; $content .= '<td>'; $likesTotal = 0; $likesYou = ''; if (count($this->list) > 0) { use_class('minierp_users'); $class_mu = new minierp_users(); $users_filter = 'id IN (' . implode(',', $this->list) . ')'; $likesName = array(); $userlist_raw = $class_mu->retrieveList($users_filter, 'username'); foreach ($userlist_raw as $u) { $likesTotal++; if ($session_userinfo['id'] == $u['id']) { $likesYou = $this->drawSingleLike($u['id'], 'You'); } else { $likesName[] = $this->drawSingleLike($u['id'], $u['username']); } } if ($likesYou != '') { $content .= $likesYou; } $likesName_total = count($likesName); if ($likesName_total == 1) { if ($likesYou != '') { $content .= ' and '; } $content .= $likesName[0]; } elseif ($likesName_total > 1) { if ($likesYou != '') { $content .= ', '; } $lastName = array_pop($likesName); $content .= implode(', ', $likesName); $content .= ' and ' . $lastName; } $content .= ' like this.'; } if ($likesTotal > 0) { $content .= '<br />'; } $content .= '<a href="" class="action">Click here to '; $content .= $likesYou == '' ? 'like' : 'stop liking'; $content .= ' this</a>'; $content .= '</td>'; //#likers $content .= '</tr></table></div>'; return $content; }
$q .= " WHERE i.department={$filter_team} AND i.status IN (1,2,3,4,5,7)"; $q .= " GROUP BY pic_id ORDER BY pic_name"; $r = tep_db_query($q); $pics = array(); $pics['0'] = 'Show All'; while ($row = tep_db_fetch_array($r)) { $pics[$row['pic_id']] = "{$row['pic_name']} ({$row['total_mims']})"; } //LOAD DATA FOR COMBO BOX PIC (UNSET) $q = tep_db_query("SELECT COUNT(DISTINCT improvements_id) AS total_mims FROM improvements WHERE department={$filter_team} AND status={$status} AND pic=0"); $row = tep_db_fetch_array($q); $pics['UNSET'] = 'Unset (' . $row['total_mims'] . ')'; if ($filter_pic != 'UNSET' && $filter_pic > 0 && !isset($pics[$filter_pic])) { use_class('minierp_users'); $class_mu = new minierp_users(); $user = $class_mu->retrieveList("id={$filter_pic}"); $pics[$user[0]['id']] = $user[0]['username'] . ' (0)'; } $tabcontent = '<div class="filter_type" style="float:left;">'; $tabcontent .= '<strong>Filter by </strong>'; $tabcontent .= '<select>' . loadComboListFromArray(array('Team', 'Owner'), null, $filter_type) . '</select>'; $tabcontent .= '</div>'; $tabcontent .= '<div class="filter_owner" style="float:left;' . ($filter_type == '1' ? '' : 'display:none;') . '">'; $tabcontent .= '<select><option value="0" class="notice">Select an Owner...</option>' . loadComboListFromArray($owners, null, $filter_owner, false) . '</select>'; $tabcontent .= '</div>'; $tabcontent .= '<div class="filter_dept" style="float:left;' . ($filter_type == '0' ? '' : 'display:none;') . '">'; //$tabcontent .= '<strong style="margin-right:5px;">Team</strong>'; $tabcontent .= '<select><option value="0" class="notice">Select a Team...</option>' . loadComboListFromArray($teams, null, $filter_team) . '</select>'; $tabcontent .= '</div>'; $tabcontent .= '<div class="filter_pic" style="float:left;' . ($filter_type == '0' ? '' : 'display:none;') . '">'; $tabcontent .= '<strong> PIC </strong>';
function drawFollowers() { use_class('minierp_users'); $class_mu = new minierp_users(); $users_filter = 'status=1'; if (count($this->list) > 0) { $users_filter .= ' OR id IN (' . implode(',', $this->list) . ')'; } $userlist = array(); $userlist_raw = $class_mu->retrieveList($users_filter, 'username'); foreach ($userlist_raw as $u) { $userlist[$u['id']] = $u['username']; } $owner_name = $userlist[$this->owner_id]; unset($userlist[$this->owner_id]); $followersName = array(); foreach ($this->list as $uid) { $followersName[$uid] = $userlist[$uid]; unset($userlist[$uid]); } $addfols = '<div class="fol-add"><select class="input">' . loadComboListFromArray($userlist, null, null, false) . '</select> <span class="boxer pointer">+</span></div>'; //$content .= $addfols; $totalfollowers = count($followersName); $content = '<div id="fol-users" style="padding-bottom:10px;">'; //$content .= '<div class="fol bold">'.$owner_name.' (Owner)</div>'; $content .= $this->drawSingleFollower($this->owner_id, $owner_name); if ($totalfollowers > 0) { foreach ($followersName as $uid => $uname) { //$content .= $this->drawSingleFollower($uid, $uname, false, ($uid==$session_user_id)); $content .= $this->drawSingleFollower($uid, $uname); } } $content .= '</div>'; //#fol-users $content .= $addfols; return $content; }