Example #1
0
 /**
  * Projects list
  * @route GET projects all
  * @param type $token
  */
 public function all_get($token)
 {
     $token_entry = new Token();
     $token_entry->get_by_valid_token($token)->get();
     if ($token_entry->exists()) {
         $projects = new Project();
         $projects->order_by('name', 'ASC');
         $projects->get();
         $response = array();
         foreach ($projects as $project) {
             $p = new stdClass();
             $p->id = $project->id;
             $p->name = $project->name;
             $p->customer_name = $project->Customer->get()->customer_name;
             if (!$p->customer_name) {
                 $p->customer_name = '-';
             }
             $p->closed = $project->closed ? TRUE : FALSE;
             $p->gitlab_project_id = $project->gitlab_project_id;
             array_push($response, $p);
         }
         $this->response($response);
     } else {
         $response = new stdClass();
         $response->status = false;
         $response->error = 'Token not found or session expired';
         $this->response($response);
     }
 }
Example #2
0
 function get($criteria = null)
 {
     $user = current_user();
     $projects = new Project();
     $activity = new Activity();
     $this->projects = $projects->get();
     $this->activity = $activity->get();
 }
Example #3
0
function estimateInfo($estimate, $o = array())
{
    $r = getRenderer();
    $project = new Project($estimate->get('project_id'));
    $project_link = $r->link('Project', array('action' => 'show', 'id' => $project->id), $project->get('name'));
    $list_items = array('Estimate' => $estimate->getName(), 'Project' => $project_link, 'Due Date' => $estimate->getData('due_date'), 'High Estimate' => $estimate->getHighEstimate(), 'Low Estimate' => $estimate->getLowEstimate(), 'Total Hours' => $estimate->getTotalHours(), 'Billable Hours' => $estimate->getBillableHours(), 'Completed' => $estimate->getData('completed') ? 'yes' : 'no', 'Notes' => $estimate->getData('notes'), 'Category' => $estimate->get('category'));
    return $r->view('basicList', $list_items);
}
Example #4
0
 public function addtaskForm()
 {
     $project = Project::get()->map('ID', 'Title');
     DateField::set_default_config('showcalendar', true);
     DateField::set_default_config('dateformat', 'dd/MM/YYYY');
     $fields = new FieldList(new DropDownField('ProjectID', 'Project', $project), new TextField('Title'), new TextAreaField('Description'), new DropDownField("Status", "Status", singleton('Task')->dbObject('Status')->enumValues()), new DateField('DueDate', 'Due Date'), new NumericField('OriginalHourEstimate', 'Est. in Hours'));
     $actions = new FieldList(new FormAction('dotaskadd', 'Submit'));
     return new Form($this, 'addtaskForm', $fields, $actions);
 }
 public function load()
 {
     parent::load();
     $model = new Project();
     $this->view->projects = $model->get();
     if (isset($_REQUEST["project_attrs_showpublication"])) {
         $model = new ProjectPublication();
         $this->view->publications = $model->getindex();
     }
     $this->setpagetitle(self::default_title());
 }
 function __construct($controller, $name)
 {
     Requirements::css(THEMES_DIR . "/openstack/css/OsLogoProgramForm.css");
     Requirements::customScript("\n            jQuery(document).ready(function() {\n\n                if(\$('#OsLogoProgramForm_Form_CurrentSponsor').prop('checked') != true){\n                    \$('#openstack-companies').hide();\n                    \$('#non-sponsor-company').show();                    \n                } else {\n                    \$('#openstack-companies').show();\n                    \$('#non-sponsor-company').hide();                                        \n                }\n\n                \$('#OsLogoProgramForm_Form_CurrentSponsor').click(function () {                \n                    \$('#openstack-companies').toggle();\n                    \$('#non-sponsor-company').toggle();\n                });\n            });\n        ");
     $companies = Company::get()->filter('MemberLevel:not', 'Mention')->where('MemberLevel IS NOT NULL')->sort('Name', 'ASC');
     if ($companies) {
         $companiesField = new DropdownField('CompanyID', 'Company', $companies->map('ID', 'Name', '--Select Company--'));
     }
     $projects = Project::get();
     if ($projects) {
         $projectsField = new CheckboxSetField('Projects', 'Select the OpenStack projects your product uses:', $projects->map('Name', 'Name'));
     }
     $fields = new FieldList(new TextField('FirstName', 'First Name'), new TextField('Surname', 'Last Name'), new EmailField('Email', 'Email Address'), new TextField('Phone', 'Phone Number'), new CheckboxSetField('Program', 'Which logo program best fits your product offering?', OsLogoProgramResponse::$avialable_programs), new LiteralField('HR', '<hr/>'), new CheckboxField('CurrentSponsor', 'My company is a Corporate Sponsor or Gold/Platinum Member of the OpenStack Foundation.'), new LiteralField('DIV', '<div id="openstack-companies">'), $companiesField, new TextField('OtherCompany', 'Other Company (if not listed above)'), new LiteralField('DIV', '</div>'), new LiteralField('DIV', '<div id="non-sponsor-company">'), new TextField('NonSponsorCompany', 'Company Name'), new LiteralField('DIV', '</div>'), new TextField('Product', 'Product or Service Name'), new LiteralField('ProductNote', 'If your proposed product name includes the OpenStack word mark, it will need to be approved as part of the licensing process.<br><br>'), new LiteralField('HR', '<hr/>'), new TextAreaField('CompanyDetails', 'Product or Service Description'), new CheckboxSetField('Category', 'Which of the following categories does your product fit into?  This will help us recommend the approprite licensing and associated marketing programs and assets:', OsLogoProgramResponse::$avialable_categories), new CheckboxSetField('Regions', 'In which regions does your company operate?', OsLogoProgramResponse::$avialable_regions), $projectsField, new CheckboxField('APIExposed', 'My product exposes the OpenStack API'));
     $actionButton = new FormAction('save', 'Request Information');
     $actions = new FieldList($actionButton);
     $validator = new RequiredFields('FirstName', 'Surname', 'Email', 'Phone');
     parent::__construct($controller, $name, $fields, $actions, $validator);
 }
Example #7
0
 public function _AggregatedProjects()
 {
     // $filter = "";
     // // Filter for local vs national blog
     // if(!$s = Subsite::currentSubsiteId()) {
     //   $filter .= "(Featured=1 OR SubsiteID=0)";
     // }
     // else{
     //   $filter .= "(SubsiteID=$s OR (SubsiteID=0 AND Circulate=1))";
     // }
     // // Category filter
     // if($category = $this->request->param('Action')=='category') {
     //   $category = $this->_getCurrentCategory();
     //   $filter .= " AND BlogCategoryID = $category->ID";
     // }
     return Project::get();
     //->where($filter);
 }
Example #8
0
 public function handlePhpError($errno, $errstr, $errfile, $errline)
 {
     $errortype = array(E_ERROR => "Error", E_WARNING => "Warning", E_PARSE => "Parsing Error", E_NOTICE => "Notice", E_CORE_ERROR => "Core Error", E_CORE_WARNING => "Core Warning", E_COMPILE_ERROR => "Compile Error", E_COMPILE_WARNING => "Compile Warning", E_USER_ERROR => "User Error", E_USER_WARNING => "User Warning", E_USER_NOTICE => "User Notice", E_STRICT => "Runtime Notice");
     // set of errors for which a var trace will be saved
     //	    $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE);
     $err = "[" . $errortype[$errno] . "] " . $errno . "; Script: " . $errfile . "; Line: " . $errline . "; Msg: " . $errstr;
     //	    if (in_array($errno, $user_errors)) {
     //	        $err .= " Var dump: " . print_r($vars) . ";";
     //	    }
     // TODO:: generate exception, if error has level for exception
     //вывод в протокол
     if ($log = Project::get($this->_config->get('logger_id'))) {
         $log->writeLog($err);
     }
     if ($this->_config->get('send_mail') === true) {
         //отправка админу на мыло TODO:: mail params get from configuration
         if ($errno == E_USER_ERROR) {
             $mail = new CMailer("Server", "Server", "Admin", ADMIN_MAIL, "Critical User Error", $err, true);
         }
     }
 }
Example #9
0
 private function datalist_order($xml)
 {
     if (!$this->bind_check($xml)) {
         return;
     }
     $uid = $this->user_profile->id;
     $from = $xml->FromUserName;
     $to = $xml->ToUserName;
     $url = _url('user/order/datalist');
     if (ENV == 'dev') {
         $url = preg_replace('/^https/', 'http', $url);
     }
     $in = Db::build_in_string(array(Order::STATUS_NEW, Order::STATUS_BLOCK, Order::STATUS_PAYDONE));
     $where = "user_id='{$uid}' and status in ({$in})";
     $orders = Order::find(0, 2, $where, 'time desc');
     $ret_text = '';
     if (!$orders) {
         $ret_text = '很遗憾,您在懒投资平台暂无投资记录。';
     } else {
         foreach ($orders as $key => $order) {
             $prj = Project::get($order->project_id);
             $total_rate = $prj->anual_rate + $prj->platform_rate + $prj->event_rate;
             $ret_text .= "单  号: {$order->id}\n";
             $ret_text .= "投资时间: {$order->time}\n";
             $ret_text .= "项目名称: {$prj->title}\n";
             $ret_text .= "预期年化: {$total_rate}%\n";
             $ret_text .= "项目期限: {$prj->days} 天\n";
             $ret_text .= "投资金额: " . Money::fen2yuan($order->amount) . " 元\n\n";
         }
     }
     $news_arr = array(array('title' => '投资记录', 'desc' => $ret_text, 'link' => $url));
     $this->wx_reply->imm_reply_news($to, $from, $news_arr);
 }
<?php

require_once 'init.php';
use Agil\View\View;
use Agil\Session\Session;
try {
    $logado = Session::get('logado');
    $request = View::route($_GET);
    $pk = $request['pk'];
    $id = $logado['id_member'];
    $sql = array('id_project' => $pk, 'status' => '1');
    $project = new Project();
    $project->fields = array('id_admin', 'title', 'website');
    $rs = $project->get($sql);
    $rs = $rs[0];
    $sql = array('id_member' => $rs['id_admin'], 'status' => '1');
    $image = new MemberImage();
    $rsImage = $image->get($sql);
    $rsImage = $rsImage ? $rsImage[0] : null;
} catch (Exception $e) {
    echo "Desculpe acabou o café";
}
?>
<div class="container">
	<div class="col-12">
		<form action="/app/team/project_member/" method="post" target="compiler">
			<div class="form-group">
				<label>Projeto</label>
				<input type="text" name="name" value="<?php 
echo $rs['title'];
?>
Example #11
0
require_once 'include/config.php';
///////////////////////////////////////////////////////////
// VARIABLES
//$_SESSION['language_locale'] = 'ES_ES';
//$_SESSION['language_id'] = $objLang->get(array("language_locale" => $_SESSION['language_locale']), "language_id");
///////////////////////////////////////////////////////////
// Texts
//$objTrad = new Traduction();
$arrText = $objTrad->get(array("language_id" => $_SESSION['language_id']));
// Experiences
$objExperience = new Experience();
$arrExperience = $objExperience->get(array("language_id" => $_SESSION['language_id']));
// Projects
$objProject = new Project();
$arrProject = $objProject->get(array("language_id" => $_SESSION['language_id'], "project_image_type_id" => IMAGE_TYPE_MINI));
// Util
$objUtil = new Util();
?>
 

<!-- Header CSS + JS -->
<?php 
include 'include/header.php';
?>

	<body>	
		
		<!-- Line top -->
		<?php 
include 'include/switcher.php';
Example #12
0
 function AddTrainingCourseForm()
 {
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::javascript("datepicker/javascript/datepicker.js");
     Requirements::javascript('registration/javascript/edit.profile.training.form.js');
     // Name Set
     $Name = new TextField('Name', "Name");
     $Name->addExtraClass('course-name');
     $Link = new TextField('Link', "Link");
     $Link->addExtraClass('course-online-link url');
     $Description = new TextareaField('Description', "Description");
     $Description->addExtraClass('course-description');
     $Online = new CheckboxField('Online', "Is Online?");
     $Online->addExtraClass('course-online-checkbox');
     $Paid = new CheckboxField('Paid', "Is Paid?");
     $Level = new DropdownField('LevelID', 'Level', TrainingCourseLevel::get()->map('ID', 'Level'));
     $Projects = new CheckboxSetField('Projects', '', Project::get()->map('ID', 'Name'));
     $Program = new HiddenField('TrainingServiceID', "TrainingServiceID", $this->training_id);
     $Course = new HiddenField('ID', "course", 0);
     $show_blank_schedule = true;
     if (isset($this->EditCourseID)) {
         $locations_dto = $this->course_repository->getLocations($this->EditCourseID);
         for ($i = 0; $i < count($locations_dto); $i++) {
             $dto = $locations_dto[$i];
             $show_blank_schedule = false;
             $City[$i] = new TextField('City[' . $i . ']', "City", $dto->getCity());
             $City[$i]->addExtraClass('city_name');
             $State[$i] = new TextField('State[' . $i . ']', "State", $dto->getState());
             $State[$i]->addExtraClass('state');
             $Country[$i] = new DropdownField('Country[' . $i . ']', $dto->getCountry(), CountryCodes::$iso_3166_countryCodes, $dto->getCountry());
             $Country[$i]->setEmptyString('-- Select One --');
             $Country[$i]->addExtraClass('country');
             $LinkS[$i] = new TextField('LinkS[' . $i . ']', "Link", $dto->getLink());
             $LinkS[$i]->addExtraClass('url');
             $StartDate[$i] = new TextField('StartDate[' . $i . ']', "Start Date", is_null($dto->getStartDate()) ? '' : $dto->getStartDate());
             $StartDate[$i]->addExtraClass('dateSelector start');
             $EndDate[$i] = new TextField('EndDate[' . $i . ']', "End Date", is_null($dto->getEndDate()) ? '' : $dto->getEndDate());
             $EndDate[$i]->addExtraClass('dateSelector end');
         }
     }
     if ($show_blank_schedule) {
         $City = new TextField('City[]', "City");
         $City->addExtraClass('city_name');
         $State = new TextField('State[]', "State");
         $State->addExtraClass('state');
         $Country = new DropdownField('Country[]', 'Country', CountryCodes::$iso_3166_countryCodes);
         $Country->setEmptyString('-- Select One --');
         $Country->addExtraClass('country');
         $StartDate = new TextField('StartDate[]', "Start Date");
         $StartDate->addExtraClass('dateSelector start');
         $EndDate = new TextField('EndDate[]', "End Date");
         $EndDate->addExtraClass('dateSelector end');
         $LinkS = new TextField('LinkS[]', "Link");
         $LinkS->addExtraClass('url');
     }
     $fields = new FieldList($Name, $Description, $Link, new LiteralField('break', '<hr/><div class="horizontal-fields">'), $Online, $Paid, $Level, $Program, $Course, new LiteralField('break', '</div><hr/>'), new LiteralField('projects', '<h4>Projects</h4>'), $Projects, new LiteralField('schedule', '<h4>Schedule</h4>'), new LiteralField('instruction', '<p class="note_online">City, State and Country can\'t be edited when a course is marked <em>Online</em>.</p>'), new LiteralField('scheduleDiv', '<div id="schedules">'));
     if (!$show_blank_schedule) {
         for ($j = 0; $j < $i; $j++) {
             $fields->push(new LiteralField('scheduleDiv', '<div class="scheduleRow">'));
             $fields->push($City[$j]);
             $fields->push($State[$j]);
             $fields->push($Country[$j]);
             $fields->push($StartDate[$j]);
             $fields->push($EndDate[$j]);
             $fields->push($LinkS[$j]);
             $fields->push(new LiteralField('scheduleDiv', '</div>'));
         }
     } else {
         $fields->push(new LiteralField('scheduleDiv', '<div class="scheduleRow">'));
         $fields->push($City);
         $fields->push($State);
         $fields->push($Country);
         $fields->push($StartDate);
         $fields->push($EndDate);
         $fields->push($LinkS);
         $fields->push(new LiteralField('scheduleDiv', '</div>'));
     }
     $fields->push(new LiteralField('scheduleDivC', '</div>'));
     $fields->push(new LiteralField('addSchedule', '<button id="addSchedule" class="action">Add Another</button>'));
     $actions = new FieldList(new FormAction('AddCourse', 'Submit'));
     $validators = new ConditionalAndValidationRule(array(new RequiredFields('Name', 'Level'), new HtmlPurifierRequiredValidator('Description')));
     $form = new Form($this, 'AddTrainingCourseForm', $fields, $actions, $validators);
     if (isset($this->EditCourseID)) {
         $form->loadDataFrom($this->course_repository->getById($this->EditCourseID));
         unset($this->EditCourseID);
     } else {
         $form->loadDataFrom($this->request->postVars());
     }
     return $form;
 }
Example #13
0
 private function accessLog($method, $line, $str)
 {
     if (($logger = Project::get($this->_config->get('logger_id'))) !== null) {
         $logger->writeLog($method . "::" . $line . "::" . $str);
     }
 }
 /** static $icon = "icon/path"; */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     //
     // Add in the projects tab with a checklist of projects
     //
     // Get all existing projects
     $projects = Project::get();
     if (!empty($projects)) {
         // create an arry('ID' => 'Name')
         $map = $projects->map('ID', 'Name');
         // create a Checkbox group based on the array
         $fields->addFieldToTab('Root.Projects', new CheckboxSetField($name = 'Projects', $title = 'Select Projects', $source = $map));
     }
     //
     // Add a image field for uploading Logo
     $logo = new CustomUploadField('Logo', 'Logo');
     $logo->setAllowedFileCategories('image');
     $logo->setFolderName('logos');
     $fields->addFieldToTab("Root.Main", $logo);
     //
     // Add fields for quote and quote author
     //
     $fields->addFieldToTab("Root.Main", new TextAreaField('PullQuote', 'Company quote about Openstack'));
     $fields->addFieldToTab("Root.Main", new TextField('PullQuoteAuthor', 'Author of the quote'));
     //
     // Add in the files tab to upload files
     //
     $fields->addFieldToTab("Root.Files", new GridField('Attachments', 'Attachments', $this->Attachments()));
     //
     // Add in the Photos tab to upload photos
     //
     $imagesTable = new GridField('Photos', 'Photos', $this->Photos());
     $fields->addFieldToTab('Root.Photos', $imagesTable);
     //
     // Add in the Links tab to set links for the OpenStack User
     //
     $linksTable = new GridField('Links', 'Links', $this->Links());
     $fields->addFieldToTab('Root.Links', $linksTable);
     //
     // Hide unneeded tabs and rename the main tab
     //
     $fields->removeFieldsFromTab('Root', array('GoogleSitemap'));
     $fields->fieldByName('Root.Main')->setTitle('User Details');
     //
     // Adjust the fields on the newly renamed User Details tab
     //
     $fields->removeFieldFromTab("Root.Main", "MenuTitle");
     $fields->renameField("Title", "Company / Org Name");
     $fields->renameField("Content", "Company / Org Description");
     $fields->addFieldToTab('Root.Main', new CheckboxField('ListedOnSite', 'Display this company on OpenStack.org'), 'Content');
     $fields->addFieldToTab('Root.Main', new CheckboxField('FeaturedOnSite', 'Feature this company on the main User Stories page'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('URL', 'Company URL'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('Headquarters', 'Company Headquarters (Location)'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('Industry'), 'Content');
     $fields->addFieldToTab('Root.Main', new HTMLEditorField('Objectives', 'Objectives for deploying OpenStack'), 'Content');
     //
     // Add category fields
     //
     $fields->addFieldToTab("Root.Main", new DropdownField('Category', 'Choose a category', $this->dbObject('Category')->enumValues()), 'Content');
     $fields->addFieldToTab("Root.Main", new DropdownField('Use Case', 'Choose a use case', $this->dbObject('UseCase')->enumValues()), 'Content');
     return $fields;
 }
Example #15
0
 public function getoldProjects()
 {
     $projects = Project::get()->sort('DueDate');
     return $projects;
 }
<?php

require_once 'init.php';
use Agil\Session\Session;
$logado = Session::get('logado');
$id_admin = $logado['id_member'];
$project = new Project();
$project->fields = array('id_project', 'title', 'slug');
$rs = $project->get(array('id_admin' => $id_admin, 'status' => '1'));
$projectMember = new ProjectMemberSet();
$projectMember->fields = array('id_project_member_set', 'id_member', 'id_project');
$memberRow = $projectMember->get(array('id_member' => $id_admin, 'status' => '2'));
foreach ($memberRow as $index => $member) {
    $response = $project->get(array('id_project' => $member['id_project'], 'status' => '1'));
    $rs[] = $response[0];
}
?>
<div class="app-pane">
	<div class="app-pane-header">
		<div class="col-6 pull-left">
			<div id="btn_group" class="btn-group">
				<a href="javascript: void(0);" class="btn" onclick="boss.bookmark.set('tab', '/app/user/view_overview/');boss.ajax.load('/app/user/view_overview/', '#app_conteiner');">Visão Geral</a>
				<a href="javascript: void(0);" class="btn btn-primary" onclick="boss.bookmark.set('tab', '/app/project/view_project/');boss.ajax.load('/app/project/view_project/', '#app_conteiner');">Projetos</a>
			</div>
		</div>
		<div class="col-6 pull-left">
			<div class="col-6 pull-left text-right">
				<buttom id="btn_new_project" onclick="boss.ajax.load('/app/project/form_create/', '#modal_dialog', 'active');" class="btn btn-success">
					<b>+</b> Novo projeto
				</buttom>
			</div>
<?php 
$counter = 0;
//RETRIEVE ALL NEW MESSAGE BOARD COMMENTS ADDED TO USER'S PROJECTS IN THE LAST SEVEN DAYS
$result = mysql_do("SELECT * FROM comments WHERE project_id IN ({$project_list}) AND created > DATE_SUB(CURDATE(),INTERVAL 7 DAY) ORDER BY `created` DESC LIMIT 20;");
while ($query_data = mysql_fetch_array($result)) {
    if ($counter == 0) {
        ?>
<h3>Comments in Your Projects</h3>

<div class="recentComments">
	<?php 
    }
    // Probably needs optimizing.
    $this_project = new Project();
    $this_project->get($query_data['project_id']);
    if ($query_data['evidence_id'] > 0) {
        $this_evidence = new Evidence();
        $this_evidence->get($query_data['evidence_id']);
    }
    if ($query_data['hypothesis_id'] > 0) {
        $this_hypothesis = new Hypothesis();
        $this_hypothesis->get($query_data['hypothesis_id']);
    }
    $this_user = new User();
    $this_user->get($query_data['user_id']);
    $counter++;
    ?>

<div class="recentComment">
if (ctype_upper($item['comment'])) {
    $comment = mb_strimwidth($item['comment'], 0, 150, "...");
} else {
    $comment = mb_strimwidth($item['comment'], 0, 150, "...");
}
$sql = array("id_project_task" => $item['id_project_task'], "status" => 1);
$fields = array("id_project");
$model = new ProjectTask();
$model->fields = $fields;
$task = $model->get($sql);
$task = $task[0];
$sql = array("id_project" => $task['id_project'], "status" => 1);
$fields = array("id_admin");
$model = new Project();
$model->fields = $fields;
$project = $model->get($sql);
$project = $project[0];
$sql = array("id_project_task_items" => $pk, "status" => 1);
$fields = array("id_member");
$model = new ProjectTaskItemsMemberSet();
$model->fields = $fields;
$rsItemMembers = $model->get($sql);
?>
<div class="window">
	<button class="icon-close-window" onclick="boss.removeClass('modal_window', 'active');boss.bookmark.remove('comment_loadplace');"></button>
	<div class="window-header">
		<div class="container">
			<h2 id="window_title"><?php 
echo $item['title'];
?>
</h2>