public function notifyOwner($isNotNew) { global $AppUI, $w2Pconfig, $locale_char_set; $mail = new w2p_Utilities_Mail(); if (intval($isNotNew)) { $mail->Subject("Project Updated: {$this->project_name} ", $locale_char_set); } else { $mail->Subject("Project Submitted: {$this->project_name} ", $locale_char_set); } $user = new CUser(); $user->loadFull($this->project_owner); if ($user && $mail->ValidEmail($user->user_email)) { if (intval($isNotNew)) { $body = $AppUI->_('Project') . ": {$this->project_name} Has Been Updated Via Project Manager. You can view the Project by clicking: "; } else { $body = $AppUI->_('Project') . ": {$this->project_name} Has Been Submitted Via Project Manager. You can view the Project by clicking: "; } $body .= "\n" . $AppUI->_('URL') . ': ' . w2PgetConfig('base_url') . '/index.php?m=projects&a=view&project_id=' . $this->project_id; $body .= "\n\n(You are receiving this email because you are the owner to this project)"; $body .= "\n\n" . $AppUI->_('Description') . ':' . "\n{$this->project_description}"; if (intval($isNotNew)) { $body .= "\n\n" . $AppUI->_('Updater') . ': ' . $AppUI->user_first_name . ' ' . $AppUI->user_last_name; } else { $body .= "\n\n" . $AppUI->_('Creator') . ': ' . $AppUI->user_first_name . ' ' . $AppUI->user_last_name; } if ($this->_message == 'deleted') { $body .= "\n\nProject " . $this->project_name . ' was ' . $this->_message . ' by ' . $AppUI->user_first_name . ' ' . $AppUI->user_last_name; } $mail->Body($body, isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : ''); $mail->To($user->user_email, true); $mail->Send(); } }
$AppUI->setState('UsrProjIdxDepartment', $_POST['department']); //if department is set, ignore the company_id field unset($company_id); } $department = $AppUI->getState('UsrProjIdxDepartment') !== null ? $AppUI->getState('UsrProjIdxDepartment') : $company_prefix . $AppUI->user_company; //if $department contains the $company_prefix string that it's requesting a company and not a department. So, clear the // $department variable, and populate the $company_id variable. if (!(strpos($department, $company_prefix) === false)) { $company_id = substr($department, strlen($company_prefix)); $AppUI->setState('UsrProjIdxCompany', $company_id); unset($department); } $tab = $AppUI->processIntState('UserVwTab', $_GET, 'tab', 0); // pull data $user = new CUser(); $user->loadFull($user_id); $contact = new CContact(); $contact->contact_id = $user->user_contact; $methods = $contact->getContactMethods(); $methodLabels = w2PgetSysVal('ContactMethods'); if (!$user) { $titleBlock = new CTitleBlock('Invalid User ID', 'helix-setup-user.png', $m, "{$m}.{$a}"); $titleBlock->addCrumb('?m=admin', 'users list'); $titleBlock->show(); } else { $countries = w2PgetSysVal('GlobalCountries'); // setup the title block $titleBlock = new CTitleBlock('View User', 'helix-setup-user.png', $m, "{$m}.{$a}"); if ($canRead) { $titleBlock->addCrumb('?m=admin', 'users list'); }
foreach ($roles as $role) { if ($role['name'] != 'Administrator') { $roles_arr[$role['id']] = $role['name']; } else { if ($perms->checkModuleItem('system', 'edit')) { $roles_arr[$role['id']] = $role['name']; } } } $roles_arr = arrayMerge(array(0 => ''), $roles_arr); if ($contact_id) { $object = new CContact(); $object->load($contact_id); } else { $object = new CUser(); $object->loadFull($object_id); } // pull companies $company = new CCompany(); $companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name'); $companies = arrayMerge(array('0' => ''), $companies); // setup the title block $ttl = $object_id ? 'Edit User' : 'Add User'; $titleBlock = new w2p_Theme_TitleBlock($ttl, 'icon.png', $m); $titleBlock->addCrumb('?m=' . $m, $m . ' list'); $titleBlock->addViewLink('user', $object_id); $titleBlock->addViewLink('contact', $object->contact_id); if ($object_id) { if ($canEdit || $object_id == $AppUI->user_id) { $titleBlock->addCrumb('?m=system&a=addeditpref&user_id=' . $object_id, 'edit preferences'); }
public function notifyOwner($isNotNew) { $user = new CUser(); $user->overrideDatabase($this->_query); $user->loadFull($this->project_owner); $subject = intval($isNotNew) ? $this->_AppUI->_('Project updated') . ': ' . $this->project_name : $this->_AppUI->_('Project submitted') . ': ' . $this->project_name; $emailManager = new w2p_Output_EmailManager($this->_AppUI); $body = $emailManager->getProjectNotify($this, $isNotNew); $mail = new w2p_Utilities_Mail(); $mail->To($user->user_email, true); $mail->Subject($subject); $mail->Body($body, isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : ''); $mail->Send(); }
public function notifyOwner($isNotNew) { global $w2Pconfig, $locale_char_set; $mail = new w2p_Utilities_Mail(); $subject = intval($isNotNew) ? "Project Updated: {$this->project_name} " : "Project Submitted: {$this->project_name} "; $user = new CUser(); $user->overrideDatabase($this->_query); $user->loadFull($this->project_owner); if ($user && $mail->ValidEmail($user->user_email)) { $emailManager = new w2p_Output_EmailManager($this->_AppUI); $body = $emailManager->getProjectNotifyOwner($this, $isNotNew); $mail->Body($body, isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : ''); $mail->To($user->user_email, true); $mail->Send(); } }