/**
  * Listing item transactions
  * @return Response
  */
 public function get_list($type = null, $iid = null)
 {
     if (!Auth::can('view_transactions')) {
         Vsession::cadd('y', __('site.not_allowed'))->cflash('status');
         return Redirect::to_action('item@list');
     }
     if ($iid !== null) {
         if (null !== ($this->iid = $this->filter_item($iid))) {
             $this->item_buttons = $this->delete_button($this->iid);
         } else {
             return Redirect::to_action('transaction@list/overview');
         }
     }
     Asset::script('jquijs', 'app/assets/js/tooltip-image.js', 'jquery');
     switch ($type) {
         case 'overview':
             return $this->get_list_view('overview');
             break;
         case 'advanced':
             return $this->get_list_view('advanced');
             break;
         default:
             return $this->get_list_view('overview');
             break;
     }
 }
예제 #2
0
 /**
  * Checkout item
  * @return Response
  */
 public function get_checkout($id = null)
 {
     if (!Auth::can('add_checkout')) {
         Vsession::cadd('y', __('site.not_allowed'))->cflash('status');
         return Redirect::to_action('item@list');
     }
     // Generating buttons
     $this->item_buttons = Navigation::item_buttons()->add_item_button(array('icon' => 'icon-arrow-down', 'link' => 'item@checkin', 'text' => __('site.check_in_item')))->add_item_button(array('icon' => 'icon-arrow-up', 'link' => 'item@checkout', 'text' => __('site.check_out_item')))->get_item_buttons();
     Asset::style('jquicss', 'app/assets/css/jquery-ui-1.10.2.custom.min.css', 'jquery');
     Asset::script('jquijs', 'app/assets/js/jquery-ui-1.10.2.custom.js', 'jquery');
     Asset::script('datepicker', 'app/assets/js/jquery.ui.datepicker-' . Config::get('application.language') . '.js', 'jquery');
     if ($id != null) {
         $id = trim(filter_var($id, FILTER_SANITIZE_NUMBER_INT));
         $item = $this->fetch_item('id', $id);
     } else {
         $item = null;
     }
     return View::make('layout.index')->nest('header', 'layout.blocks.header', array('submenu' => $this->submenu))->nest('main', 'item.checkout', array('item' => $item, 'status' => $this->status, 'item_buttons' => $this->item_buttons));
 }
예제 #3
0
파일: routes.php 프로젝트: eliasyanni/bugs
    Asset::script('jquery-ui', 'app/assets/js/jquery-ui.js');
    Asset::script('app', 'app/assets/js/app.js', 'jquery');
    Asset::script('app2', 'app/assets/js/sortable-issues.js', 'jquery');
    Asset::script('swf', '/app/assets/js/uploadify/swfobject.js', 'app');
    Asset::script('uploadify', '/app/assets/js/uploadify/jquery.uploadify.v2.1.4.min.js', 'app');
    Asset::script('project', '/app/assets/js/project.js', 'uploadify');
    if (!isset($view->sidebar)) {
        $view->with('sidebar', View::make('project.sidebar'));
    }
    $view->active = 'projects';
});
View::composer('todo.index', function ($view) {
    Asset::script('app', 'app/assets/js/todo.js', 'jquery');
});
View::composer('user.issues', function ($view) {
    Asset::script('app', 'app/assets/js/todo-issues.js', 'jquery');
});
View::composer('layouts.login', function ($view) {
    Asset::style('login', 'app/assets/css/login.css');
});
Event::listen('404', function () {
    return Response::error('404');
});
Event::listen('500', function () {
    return Response::error('500');
});
/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
*/
예제 #4
0
<?php

return array('layouts.admin.default' => array('name' => 'admin_layout', function ($view) {
    Asset::script('jquery', 'js/jquery-1.7.1.js');
    Asset::script('twipsy', 'js/twipsy.js');
    Asset::script('admin', 'js/admin.js');
    Asset::style('bootstrap', 'css/bootstrap.css');
    Asset::style('admin', 'css/admin.css');
    $view->nest('header', 'partials.header');
    $view->nest('footer', 'partials.footer');
}), 'layouts.site.default' => array('name' => 'site_layout', function ($view) {
    Asset::script('jquery', 'js/jquery-1.7.1.js');
    Asset::script('site', 'js/site.js');
    Asset::style('bootstrap', 'css/bootstrap.css');
    Asset::style('site', 'css/site.css');
    $view->nest('header', 'partials.header');
    $view->nest('nav', 'partials.nav');
    $view->nest('footer', 'partials.footer');
}));
예제 #5
0
 public function get_new()
 {
     Asset::script('project-new', '/app/assets/js/project-new.js', array('app'));
     return $this->layout->with('active', 'projects')->nest('content', 'projects.new');
 }
예제 #6
0
    Asset::style('app', 'app/assets/css/app.css');
    Asset::script('jquery', 'app/assets/js/jquery.js');
    Asset::script('jquery-ui', 'app/assets/js/jquery-ui.js');
    Asset::script('app', 'app/assets/js/app.js', 'jquery-ui');
    if (!isset($view->sidebar)) {
        $view->with('sidebar', View::make('layouts.blocks.default_sidebar'));
    }
});
View::composer('layouts.project', function ($view) {
    Asset::style('app', 'app/assets/css/app.css');
    Asset::script('jquery', 'app/assets/js/jquery.js');
    Asset::script('jquery-ui', 'app/assets/js/jquery-ui.js');
    Asset::script('app', 'app/assets/js/app.js', 'jquery');
    Asset::script('swf', '/app/assets/js/uploadify/swfobject.js', 'app');
    Asset::script('uploadify', '/app/assets/js/uploadify/jquery.uploadify.v2.1.4.min.js', 'app');
    Asset::script('project', '/app/assets/js/project.js', 'uploadify');
    if (!isset($view->sidebar)) {
        $view->with('sidebar', View::make('project.sidebar'));
    }
    $view->active = 'projects';
});
View::composer('layouts.login', function ($view) {
    Asset::style('login', 'app/assets/css/login.css');
});
Event::listen('404', function () {
    return Response::error('404');
});
Event::listen('500', function () {
    return Response::error('500');
});
/*
예제 #7
0
/*
|--------------------------------------------------------------------------
| Composing
|--------------------------------------------------------------------------
*/
View::composer('layout.index', function ($view) {
    Asset::style('bootstrapcss', 'app/assets/css/bootstrap.min.css');
    Asset::style('datatablescss', 'app/assets/css/jquery.dataTables.css');
    Asset::style('apprisecss', 'app/assets/css/apprise-v2.css');
    Asset::style('style', 'app/assets/css/style.css');
    Asset::style('bs_css', 'app/assets/css/bootstrap-tagsinput.css');
    Asset::script('jquery', 'app/assets/js/jquery-1.9.1.min.js');
    Asset::script('bootstrap', 'app/assets/js/bootstrap.min.js');
    Asset::script('datatables', 'app/assets/js/jquery.dataTables.min.js');
    Asset::script('apprise', 'app/assets/js/apprise-v2.min.js', 'jquery');
    Asset::script('bs_input_script', 'app/assets/js/bootstrap-tagsinput.js');
});
/*
|--------------------------------------------------------------------------
| Application 404 & 500 Error Handlers
|--------------------------------------------------------------------------
|
| To centralize and simplify 404 handling, Laravel uses an awesome event
| system to retrieve the response. Feel free to modify this function to
| your tastes and the needs of your application.
|
| Similarly, we use an event to handle the display of 500 level errors
| within the application. These errors are fired when there is an
| uncaught exception thrown in the application.
|
*/
예제 #8
0
    /**
     * Load the JavaScript behavior.
     *
     * @param   string  $group   The pane identifier.
     * @param   array   $params  Array of options.
     * @return  void
     */
    protected static function behavior($group, $params = array())
    {
        static $loaded = array();
        if (!array_key_exists((string) $group, $loaded)) {
            $options = array();
            $opt['onActive'] = isset($params['onActive']) ? $params['onActive'] : null;
            $opt['onBackground'] = isset($params['onBackground']) ? $params['onBackground'] : null;
            $opt['display'] = isset($params['startOffset']) ? (int) $params['startOffset'] : null;
            $opt['useStorage'] = isset($params['useCookie']) && $params['useCookie'] ? 'true' : 'false';
            $opt['titleSelector'] = "'dt.tabs'";
            $opt['descriptionSelector'] = "'dd.tabs'";
            foreach ($opt as $k => $v) {
                if ($v) {
                    $options[] = $k . ': ' . $v;
                }
            }
            $options = '{' . implode(',', $options) . '}';
            Behavior::framework(true);
            \App::get('document')->addScriptDeclaration('jQuery(document).ready(function($){
					$("dl#' . $group . '.tabs").tabs();
				});');
            Asset::script('system/jquery.tabs.js', false, true);
            $loaded[(string) $group] = true;
        }
    }
예제 #9
0
        return Redirect::to('login');
    }
});
Route::filter('ajax', function () {
    if (!Request::ajax()) {
        return Response::error('404');
    }
});
Route::filter('project', function () {
    Project::load_project(Request::route()->parameters[0]);
    if (!Project::current()) {
        return Response::error('404');
    }
});
Route::filter('issue', function () {
    Asset::script('ckeditor', 'app/ckeditor/ckeditor.js');
    Project\Issue::load_issue(Request::route()->parameters[1]);
    if (isset(Request::route()->parameters[2]) && Request::route()->parameters[2] == 'status') {
        $to = "*****@*****.**";
        $subject = "My subject";
        $txt = "Hello world!";
        $headers = "From: webmaster@example.com" . "\r\n" . "CC: somebodyelse@example.com";
        mail($to, $subject, $txt, $headers);
    }
    if (!Project\Issue::current()) {
        return Response::error('404');
    }
});
Route::filter('permission', function ($permission) {
    if (!Auth::user()->permission($permission)) {
        return Response::error('500');