Skip to content

Commit

Permalink
Merge pull request #952 from takeit/master
Browse files Browse the repository at this point in the history
Wrong path for css/images in installer #919 & UPGRADE_4_3.md update & CS-5436
  • Loading branch information
Paweł Mikołajczuk committed Jan 26, 2015
2 parents 5754447 + 1663e3e commit fdde5ba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public function indexAction()
'/imagearchive/do_add.php',
'/users/authors_ajax/detail.php',
'/users/authors_ajax/grid.php',
$prefix . 'password_recovery.php',
$prefix . 'password_check_token.php',
'/articles/locations/popup.php',
'/articles/locations/preview.php',
'/articles/locations/search.php',
Expand Down
128 changes: 0 additions & 128 deletions newscoop/application/modules/admin/controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,134 +32,6 @@ public function init()

Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator.phtml');

$this->_helper->contextSwitch
->addActionContext('index', 'json')
->initContext();

$this->_helper->contextSwitch
->addActionContext('table', 'json')
->initContext();

}

public function tableAction()
{
$users = $this->_helper->service('user')->getCollection(
array('q' => null, 'status' => null, 'groups' => null),
array('username' => 'asc', 'email' => 'asc'),
50000,
null
);
$this->view->users = array();
foreach ($users as $user) {
$userView = $user->getDataTableView($this->view);
$this->view->users[] = $userView;
}
return;
}

public function indexAction()
{
$translator = \Zend_Registry::get('container')->getService('translator');
$form = new Admin_Form_UserCriteria();
$form->groups->addMultiOptions($this->_helper->service('user')->getGroupOptions());
$form->isValid($this->getRequest()->getParams());

$criteria = $form->getValues();
if ($criteria['status'] === null) {
$criteria['status'] = 1;
}

$users = $this->_helper->service('user')->getCollection(
$criteria,
array('username' => 'asc', 'email' => 'asc'),
self::LIMIT,
$this->_getParam('start')
);

$this->view->pagination = $users;
$this->view->criteria = (object) array_filter($criteria, function ($value) { return $value !== null; });
$this->view->users = array();
foreach ($users as $user) {
$userView = $user->getEditView($this->view);
$userView->links[] = array(
'rel' => 'rename',
'href' => $this->view->url(array(
'module' => 'admin',
'controller' => 'user',
'action' => 'rename',
'user' => $userView->id,
), 'default', true),
);
$this->view->users[] = $userView;
}

if ($this->_helper->contextSwitch->getCurrentContext() === 'json') {
return;
}

$this->view->counts = array();
foreach ($form->status->getMultiOptions() as $status => $label) {
$this->view->counts[$status] = $this->_helper->service('user')->countBy(array('status' => $status));
}

$this->view->form = $form;
$this->view->actions = array(
array(
'label' => $translator->trans('Create new account', array(), 'users'),
'module' => 'admin',
'controller' => 'user',
'action' => 'create',
'class' => 'add',
),
);

$this->view->activeCount = $this->_helper->service('user')->countBy(array('status' => User::STATUS_ACTIVE));
$this->view->pendingCount = $this->_helper->service('user')->countBy(array('status' => User::STATUS_INACTIVE));
$this->view->inactiveCount = $this->_helper->service('user')->countBy(array('status' => User::STATUS_DELETED));
$this->view->filter = $this->_getParam('filter', '');
}

public function listAction()
{
$this->_helper->layout->disableLayout();

$filters = array(
'active' => User::STATUS_ACTIVE,
'pending' => User::STATUS_INACTIVE,
'inactive' => User::STATUS_DELETED,
);

$filter = $this->_getParam('filter', 'active');
if (!array_key_exists($filter, $filters)) {
$filter = 'active';
}

$page = $this->_getParam('page', 1);
$count = $this->_helper->service('user')->countBy(array('status' => $filters[$filter]));
$paginator = Zend_Paginator::factory($count);
$paginator->setItemCountPerPage(self::LIMIT);
$paginator->setCurrentPageNumber($page);
$paginator->setView($this->view);
$paginator->setDefaultScrollingStyle('Sliding');
$this->view->paginator = $paginator;

$this->view->users = $this->_helper->service('user')->findBy(array(
'status' => $filters[$filter],
), array(
'username' => 'asc',
'email' => 'asc',
), self::LIMIT, ($paginator->getCurrentPageNumber() - 1) * self::LIMIT);

$this->render("list-$filter");
}

public function searchAction()
{
$this->_helper->layout->disableLayout();

$q = $this->_getParam('q', null);
$this->view->users = $this->_helper->service('user.search')->find($q);
}

public function createAction()
Expand Down
8 changes: 4 additions & 4 deletions newscoop/docs/UPGRADE_4_3.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Upgrading Newscoop version 4.2.3/4.2.4 to 4.3
## Upgrading Newscoop version 4.2.3/4.2.4/4.3.x to 4.3.x

**Important!** Remember to backup all your data before performing upgrade.

1. Remove `newscoop/vendor` directory and its content from your current Newscoop instance (`sudo rm -rf newscoop/vendor`).
2. Copy Newscoop 4.3 files over the 4.2.3/4.2.4 files (e.g. `sudo cp -r /home/user/Newscoop43/newscoop/ /var/www/newscoop/`).
2. Copy Newscoop 4.3.x files over the 4.2.3/4.2.4/4.3.x files (e.g. `sudo cp -r /home/user/Newscoop43/newscoop/ /var/www/newscoop/`).
3. Run `upgrade.php` script. (Go to `http://www.example.com/upgrade.php`)
4. Check if there are any instructions to follow in the output of upgrade script. If so, then follow the steps.
5. When it is done, clear the cache folder: `sudo rm -rf cache/*`.
Expand All @@ -13,11 +13,11 @@
9. Clear the cache folder for the last time: `sudo rm -rf cache/*`.
10. You are done!

Above steps are required to upgrade Newscoop 4.2.3/4.2.4 to 4.3.
Above steps are required to upgrade Newscoop 4.2.3/4.2.4/4.3.x to 4.3.x.

We also recommend to update all the legacy plugins: `debate`, `poll`, `soundcloud`, `recaptcha`, because they will not be compatible with Newscoop 4.3 anymore.

How to do this?:
How to do this?: (only when upgrading from 4.2.3/4.2.4 to 4.3.x)

* Make a backup of `newscoop/plugins/` directory.
* Remove the whole `newscoop/plugins/` content(Linux command: `sudo rm -rf newscoop/plugins/*`).
Expand Down
6 changes: 3 additions & 3 deletions newscoop/install/Resources/views/layout.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html lang="en" dir="ltr">
<head>
<title>Newscoop Installer</title>
<link rel="shortcut icon" href="/admin-style/images/7773658c3ccbf03954b4dacb029b2229.ico" />
<link rel="stylesheet" type="text/css" media="screen" href="/install/Resources/assets/css/main.css" />
<link rel="shortcut icon" href="../admin-style/images/7773658c3ccbf03954b4dacb029b2229.ico" />
<link rel="stylesheet" type="text/css" media="screen" href="../install/Resources/assets/css/main.css" />
</head>
<body>
<div class="wrapper">
<img class="logo" src="/install/Resources/assets/css/logo.png">
<img class="logo" src="../install/Resources/assets/css/logo.png">
<div class="main_box {% block fixed %}fixed{% endblock %}">
<div class="top">
<h2>{% block header %}{% endblock %}</h2>
Expand Down

0 comments on commit fdde5ba

Please sign in to comment.