本文整理汇总了PHP中projects::getUserProjects方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::getUserProjects方法的具体用法?PHP projects::getUserProjects怎么用?PHP projects::getUserProjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::getUserProjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* run - display template and edit data
*
* @access public
*
*/
public function run()
{
$tpl = new template();
$helper = new helper();
$projectObj = new projects();
$user = new users();
$language = new language();
$language->setModule('tickets');
$lang = $language->readIni();
$projects = $projectObj->getUserProjects("open");
$msgKey = '';
if (isset($_POST['save'])) {
$values = array('headline' => $_POST['headline'], 'type' => $_POST['type'], 'description' => $_POST['description'], 'priority' => $_POST['priority'], 'projectId' => $_POST['project'], 'editorId' => implode(',', $_POST['editorId']), 'userId' => $_SESSION['userdata']['id'], 'date' => $helper->timestamp2date(date("Y-m-d H:i:s"), 2), 'dateToFinish' => $_POST['dateToFinish'], 'status' => 3, 'browser' => $_POST['browser'], 'os' => $_POST['os'], 'resolution' => $_POST['resolution'], 'version' => $_POST['version'], 'url' => $_POST['url'], 'editFrom' => $_POST['editFrom'], 'editTo' => $_POST['editTo']);
if ($values['headline'] === '') {
$tpl->setNotification('ERROR_NO_HEADLINE', 'error');
} elseif ($values['description'] === '') {
$tpl->setNotification('ERROR_NO_DESCRIPTION', 'error');
} elseif ($values['projectId'] === '') {
$tpl->setNotification('ERROR_NO_PROJECT', 'error');
} else {
$values['date'] = $helper->timestamp2date($values['date'], 4);
$values['dateToFinish'] = $helper->timestamp2date($values['dateToFinish'], 4);
$values['editFrom'] = $helper->timestamp2date($values['editFrom'], 4);
$values['editTo'] = $helper->timestamp2date($values['editTo'], 4);
// returns last inserted id
$id = $this->addTicket($values);
//Take the old value to avoid nl character
$values['description'] = $_POST['description'];
$values['date'] = $helper->timestamp2date($values['date'], 2);
$values['dateToFinish'] = $helper->timestamp2date($values['dateToFinish'], 2);
$values['editFrom'] = $helper->timestamp2date($values['editFrom'], 2);
$values['editTo'] = $helper->timestamp2date($values['editTo'], 2);
$msgKey = 'TICKET_ADDED';
$tpl->setNotification('TICKET_ADDED', 'success');
//Fileupload
if (htmlspecialchars($_FILES['file']['name']) != '') {
$upload = new fileupload();
$upload->initFile($_FILES['file']);
if ($upload->error == '') {
// hash name on server for security reasons
$newname = md5($id . time());
//Encrypt filename on server
$upload->renameFile($newname);
if ($upload->upload() === true) {
$fileValues = array('encName' => $upload->file_name, 'realName' => $upload->real_name, 'date' => date("Y-m-d H:i:s"), 'ticketId' => $id, 'userId' => $_SESSION['userdata']['id']);
$this->addFile($fileValues);
} else {
$msgKey = 'ERROR_FILEUPLOAD_' . $upload->error . '';
}
} else {
$msgKey = 'ERROR_FILEUPLOAD_' . $upload->error . '';
}
}
/*
//Send mail
$mail = new mailer();
$row = $projectObj->getProject($values['projectId']);
$mail->setSubject(''.$lang['ZYPRO_NEW_TICKET'].' "'.$row['name'].'" ');
$username = $user->getUser($_SESSION['userdata']['id']);
$url = 'http://'.$_SERVER['HTTP_HOST'].'/index.php?act=tickets.showTicket&id='.$id.'';
$mailMsg = "".$lang['NEW_TICKET_MAIL_1']." ".$id." ".$lang['NEW_TICKET_MAIL_2']." ".$username['lastname']." ".$username['firstname']." ".$lang['NEW_TICKET_MAIL_3']." ".$row['name']." ".$lang['NEW_TICKET_MAIL_4']." ".$url." ".$lang['NEW_TICKET_MAIL_5']."";
$mail->setText($mailMsg);
if(is_numeric($values['editorId']) === false ){
$mails = $user->getMailRecipients($values['projectId']);
}else{
$mails = $user->getSpecificMailRecipients($id);
}
$to = array();
foreach($mails as $row){
array_push($to, $row['user']);
}
$mail->sendMail($to);
*/
}
$tpl->assign('values', $values);
}
//.........这里部分代码省略.........