This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getExportFilename() | |
{ | |
return "<?php echo isset($this->config['export']['filename']) ? $this->config['export']['filename'] : ucfirst($this->getModuleName()).'_Export' ?>_".date("Y-m-d_Hi"); | |
<?php unset($this->config['export']['filename']) ?> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class sfAdminRouteCollection extends sfDoctrineRouteCollection | |
{ | |
protected function generateRoutes() | |
{ | |
parent::generateRoutes(); | |
if (!isset($this->options['with_export']) || $this->options['with_export']) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[email protected] | |
# run daily crons | |
5 1 * * 1 /path/to/project/cron.php --daily > /var/log/cron_prod.log | |
10 1 * * 1 /path/to/other-project/cron.php --daily > /var/log/cron_dev.log | |
# run weekly crons | |
0 0 * * * /path/to/project/cron.php --weekly > /var/log/cron_prod.log | |
5 0 * * * /path/to/other-project/cron.php --weekly > /var/log/cron_dev.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
if (!isset($argv) || !count($argv)) | |
{ | |
throw new Exception("Please provide path of crons to flush"); | |
} | |
foreach ($argv as $path) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function link_to_current($title, $params = array(), $options = array()) | |
{ | |
$currentRoute = sfContext::getInstance()->getRouting()->getCurrentRouteName(); | |
$currentParams = sfContext::getInstance()->getRequest()->getParameterHolder()->getAll(); | |
unset($currentParams['module'], $currentParams['action']); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="sf_admin_pagination"> | |
<?php $img = image_tag(sfConfig::get('sf_admin_module_web_dir').'/images/first.png', array('alt' => __('First page', array(), 'sf_admin'), 'title' => __('First page', array(), 'sf_admin'))) ?> | |
<?php echo link_to_current($img, array('page' => 1)) ?> | |
<?php $img = image_tag(sfConfig::get('sf_admin_module_web_dir').'/images/previous.png', array('alt' => __('Previous page', array(), 'sf_admin'), 'title' => __('Previous page', array(), 'sf_admin'))) ?> | |
<?php echo link_to_current($img, array('page' => $pager->getPreviousPage())) ?> | |
<?php foreach ($pager->getLinks() as $page): ?> | |
<?php if ($page == $pager->getPage()): ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
while line = STDIN.gets do | |
line.sub!(/\d,\"/) {|s| s.sub(',"', ' - ')} | |
line.sub!(/\d,/) {|s| s.sub(',', ' - ')} | |
line.gsub!('""', '"'); | |
line.sub!(/"$/, ''); | |
puts line | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Extended Doctrine Query class providing a few additional functions | |
* for wrapping your where clauses more efficiently | |
*/ | |
class Doctrine_Query_Extra extends Doctrine_Query | |
{ | |
public function addOrderBy($orderby, $values = null) | |
{ | |
if ($values !== null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function array_msort($array, $cols) | |
{ | |
// clean cols | |
$cols = (array) $cols; | |
foreach ($cols as $col => $order) { | |
if (is_int($col)) { | |
// unassociative array. | |
$cols[$order] = SORT_ASC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# redMine - project management software | |
# Copyright (C) 2006-2007 Jean-Philippe Lang | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |