本文整理汇总了PHP中Goteo\Model\Project::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getList方法的具体用法?PHP Project::getList怎么用?PHP Project::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Goteo\Model\Project
的用法示例。
在下文中一共展示了Project::getList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
//.........这里部分代码省略.........
if (isset($log_text)) {
// Evento Feed
$log = new Feed();
$log->setTarget($project->id);
$log->populate(Text::_('Cambio estado/fechas/cuentas/nodo de un proyecto desde el admin'), '/admin/projects', \vsprintf($log_text, array(Feed::item('user', $_SESSION['user']->name, $_SESSION['user']->id), Feed::item('project', $project->name, $project->id))));
$log->doAdmin('admin');
Message::Info($log->html);
if (!empty($errors)) {
Message::Error(implode('<br />', $errors));
}
if ($action == 'publish') {
// si es publicado, hay un evento publico
$log->populate($project->name, '/project/' . $project->id, Text::html('feed-new_project'), $project->gallery[0]->id);
$log->doPublic('projects');
}
unset($log);
if (empty($redir)) {
throw new Redirection('/admin/projects/list');
} else {
throw new Redirection($redir);
}
}
if ($action == 'report') {
// informe financiero
// Datos para el informe de transacciones correctas
$Data = Model\Invest::getReportData($project->id, $project->status, $project->round, $project->passed);
return new View('view/admin/index.html.php', array('folder' => 'projects', 'file' => 'report', 'project' => $project, 'Data' => $Data));
}
if ($action == 'dates') {
// cambiar fechas
return new View('view/admin/index.html.php', array('folder' => 'projects', 'file' => 'dates', 'project' => $project));
}
if ($action == 'accounts') {
$accounts = Model\Project\Account::get($project->id);
// cambiar fechas
return new View('view/admin/index.html.php', array('folder' => 'projects', 'file' => 'accounts', 'project' => $project, 'accounts' => $accounts));
}
if ($action == 'images') {
// imagenes
$images = array();
// secciones
$sections = Model\Project\Image::sections();
foreach ($sections as $sec => $secName) {
$secImages = Model\Project\Image::get($project->id, $sec);
foreach ($secImages as $img) {
$images[$sec][] = $img;
}
}
return new View('view/admin/index.html.php', array('folder' => 'projects', 'file' => 'images', 'project' => $project, 'images' => $images, 'sections' => $sections));
}
if ($action == 'move') {
// cambiar el nodo
return new View('view/admin/index.html.php', array('folder' => 'projects', 'file' => 'move', 'project' => $project, 'nodes' => $nodes));
}
if ($action == 'rebase') {
// cambiar la id
return new View('view/admin/index.html.php', array('folder' => 'projects', 'file' => 'rebase', 'project' => $project));
}
// Rechazo express
if ($action == 'reject') {
if (empty($project)) {
Message::Error(Text::_('No hay proyecto sobre el que operar'));
} else {
// Obtenemos la plantilla para asunto y contenido
$template = Template::get(40);
// Sustituimos los datos
$subject = str_replace('%PROJECTNAME%', $project->name, $template->title);
$search = array('%USERNAME%', '%PROJECTNAME%');
$replace = array($project->user->name, $project->name);
$content = \str_replace($search, $replace, $template->text);
// iniciamos mail
$mailHandler = new Mail();
$mailHandler->to = $project->user->email;
$mailHandler->toName = $project->user->name;
$mailHandler->subject = $subject;
$mailHandler->content = $content;
$mailHandler->html = true;
$mailHandler->template = $template->id;
if ($mailHandler->send()) {
Message::Info('Se ha enviado un email a <strong>' . $project->user->name . '</strong> a la dirección <strong>' . $project->user->email . '</strong>');
} else {
Message::Error('Ha fallado al enviar el mail a <strong>' . $project->user->name . '</strong> a la dirección <strong>' . $project->user->email . '</strong>');
}
unset($mailHandler);
}
throw new Redirection('/admin/projects/list');
}
if (!empty($filters['filtered'])) {
$projects = Model\Project::getList($filters, $_SESSION['admin_node']);
} else {
$projects = array();
}
$status = Model\Project::status();
$categories = Model\Project\Category::getAll();
//@CONTRACTSYS
$calls = array();
// la lista de nodos la hemos cargado arriba
$orders = array('name' => Text::_('Nombre'), 'updated' => Text::_('Enviado a revision'));
return new View('view/admin/index.html.php', array('folder' => 'projects', 'file' => 'list', 'projects' => $projects, 'filters' => $filters, 'status' => $status, 'categories' => $categories, 'calls' => $calls, 'nodes' => $nodes, 'orders' => $orders));
}