Ejemplo n.º 1
0
 public static function link_generate($report_id = false, $options = array(), $link_options = array())
 {
     $key = 'report_id';
     if ($report_id === false && $link_options) {
         foreach ($link_options as $link_option) {
             if (isset($link_option['data']) && isset($link_option['data'][$key])) {
                 ${$key} = $link_option['data'][$key];
                 break;
             }
         }
         if (!${$key} && isset($_REQUEST[$key])) {
             ${$key} = $_REQUEST[$key];
         }
     }
     $bubble_to_module = false;
     if (!isset($options['type'])) {
         $options['type'] = 'report';
     }
     $options['page'] = 'report_admin';
     if (!isset($options['arguments'])) {
         $options['arguments'] = array();
     }
     $options['arguments']['report_id'] = $report_id;
     $options['module'] = 'report';
     if ((int) $report_id > 0) {
         $data = self::get_report($report_id);
         $options['data'] = $data;
     } else {
         $data = array();
         if (!isset($options['full']) || !$options['full']) {
             // we are not doing a full <a href> link, only the url (eg: create new report)
         } else {
             // we are trying to do a full <a href> link -
             return _l('N/A');
         }
     }
     // what text should we display in this link?
     $options['text'] = !isset($data['report_id']) || !trim($data['report_id']) ? _l('N/A') : $data['report_id'];
     array_unshift($link_options, $options);
     if (!module_security::has_feature_access(array('name' => 'Customers', 'module' => 'customer', 'category' => 'Customer', 'view' => 1, 'description' => 'view'))) {
         if (!isset($options['full']) || !$options['full']) {
             return '#';
         } else {
             return isset($options['text']) ? $options['text'] : _l('N/A');
         }
     }
     if ($bubble_to_module) {
         global $plugins;
         return $plugins[$bubble_to_module['module']]->link_generate(false, array(), $link_options);
     } else {
         // return the link as-is, no more bubbling or anything.
         // pass this off to the global link_generate() function
         return link_generate($link_options);
     }
 }
Ejemplo n.º 2
0
 function init()
 {
     $this->version = 2.381;
     // 2.382 - 2015-06-07 - new extra field settings button
     // 2.381 - 2015-05-03 - responsive improvements
     // 2.38 - 2015-03-15 - table manager update
     // 2.379 - 2015-03-14 - new help system
     // 2.378 - 2015-01-28 - table sorting by extra fields
     // 2.377 - 2015-01-14 - hooks added to table print out and data processing
     // 2.376 - 2014-12-17 - signup form on login
     // 2.375 - 2014-11-26 - improved form framework
     // 2.374 - 2014-11-05 - welcome_message_role_X template support
     // 2.373 - 2014-08-14 - dashboard widget permission fix
     // 2.372 - 2014-08-12 - new theme support
     // 2.371 - 2014-08-10 - table layout improvements
     // 2.37 - 2014-08-10 - table layout improvements
     // 2.369 - 2014-07-31 - working on better responsive layout
     // 2.368 - 2014-07-31 - menu generation bug fix
     // 2.367 - 2014-07-28 - menu generation speed improvement
     // 2.366 - 2014-07-21 - whitelabel home page fix
     // 2.365 - 2014-07-14 - better theme css caching
     // 2.364 - 2014-07-14 - better theme css caching
     // 2.363 - 2014-07-13 - better theme css caching
     // 2.362 - 2014-07-05 - theme translation fix
     // 2.361 - 2013-11-20 - metis bootstrap/ui button js fix
     // 2.36 - 2013-11-15 - working on new bootstrap UI interface - WOW!
     // 2.35 - 2013-10-01 - mobile menu fix up
     // 2.349 - 2013-08-28 - more work on upcoming new themes
     // 2.348 - 2013-06-18 - easy custom CSS option added
     // 2.347 - 2013-05-27 - dashboard improvements.
     // 2.2 - handling including of files.
     // 2.3 - new pro dark theme beginnings
     // 2.31 - theme selector on settings page
     // 2.32 - change loction of mobile files and custom files.
     // 2.33 - demo theme support
     // 2.34 - left menu theme.
     // 2.341 - left menu update.
     // 2.342 - foreach() bug fix
     // 2.343 - permissoin fix
     // 2.344 - php5/6 fix
     // 2.345 - mobile layout fixes
     // 2.346 - css fixes
     $this->links = array();
     $this->module_name = "theme";
     $this->module_position = 8882;
     if (file_exists('includes/plugin_theme/pages/theme_settings.php') && module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
         $this->links[] = array("name" => "Theme", "p" => "theme_settings", 'args' => array(), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0);
     }
     // todo - allow themes to override this hook, eg: hook_remove('layout_column_half','module_theme::hook_handle_layout_column');
     hook_add('layout_column_half', 'module_theme::hook_handle_layout_column');
     hook_add('layout_column_thirds', 'module_theme::hook_handle_layout_column');
 }
Ejemplo n.º 3
0
 public function pre_menu()
 {
     if (self::is_plugin_enabled()) {
         if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
             $this->links[] = array("name" => "Social", "p" => "social_settings", "args" => array('social_id' => false), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0);
         }
         if ($this->can_i('view', 'Social') && class_exists('ucm_twitter', false) && class_exists('ucm_facebook', false)) {
             $twitter = new ucm_twitter();
             $facebook = new ucm_facebook();
             $unread = $facebook->get_unread_count() + $twitter->get_unread_count();
             $this->links['social'] = array("name" => _l('Social') . ($unread > 0 ? " <span class='menu_label'>" . $unread . "</span>" : ''), "p" => "social_admin", 'icon_name' => 'comment-o');
         }
     }
 }
Ejemplo n.º 4
0
 public function pre_menu()
 {
     if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
         $this->links[] = array("name" => "Calendar", "p" => "calendar_settings", "args" => array('calendar_id' => false), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0);
     }
     if ($this->can_i('view', 'Calendar')) {
         $this->links['calendar'] = array("name" => 'Calendar', "p" => "calendar_admin", 'icon_name' => 'calendar');
         // only display if a customer has been created.
         if (isset($_REQUEST['customer_id']) && (int) $_REQUEST['customer_id'] > 0) {
             $link_name = _l('Calendar');
             $this->links['calendar_customer'] = array("name" => $link_name, "p" => "calendar_admin", 'args' => array('calendar_id' => false), 'holder_module' => 'customer', 'holder_module_page' => 'customer_admin_open', 'menu_include_parent' => 0, 'icon_name' => 'calendar');
         }
     }
 }
Ejemplo n.º 5
0
 public function pre_menu()
 {
     if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view')) && $this->can_i('view', 'Security Roles', 'Security')) {
         $this->links[] = array("name" => "User Roles", "p" => "security_role", "args" => array('security_role_id' => false), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0, 'order' => 4);
         $this->links[] = array("name" => "Login History", "p" => "login_history", "args" => array('security_role_id' => false), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0, 'order' => 40);
     }
     if (class_exists('module_template', false)) {
         module_template::init_template('password_reset', 'Dear {NAME},<br>
 <br>
 Please click the link below to login and reset your password.<br><br>
 <a href="{AUTO_LOGIN_URL}">CLICK HERE</a> <br/><br/>
 Thank you,<br><br>
 {FROM_NAME}
 ', 'Reset your password', array('NAME' => 'Users Name'));
     }
 }
Ejemplo n.º 6
0
 public function pre_menu()
 {
     if (module_social::is_plugin_enabled() && self::is_plugin_enabled()) {
         if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
             $this->links[] = array("name" => "Facebook", "p" => "facebook_settings", "args" => array('social_facebook_id' => false), 'holder_module' => 'social', 'holder_module_page' => 'social_settings', 'menu_include_parent' => 1);
         }
         global $load_modules;
         if (module_social::can_i('view', 'Facebook', 'Social', 'social') && $load_modules && $load_modules[0] == 'social') {
             $accounts = self::get_accounts();
             $facebook = new ucm_facebook();
             foreach ($accounts as $account) {
                 $facebook_account = new ucm_facebook_account($account['social_facebook_id']);
                 $unread = $facebook->get_unread_count(array('social_facebook_id' => $account['social_facebook_id']));
                 $this->links[] = array("name" => $facebook_account->get('facebook_name') . ($unread > 0 ? " <span class='menu_label'>" . $unread . "</span>" : ''), "p" => "social_facebook_list", "args" => array('social_facebook_id' => $account['social_facebook_id'], 'social_twitter_id' => false), 'holder_module' => 'social', 'holder_module_page' => 'social_admin', 'menu_include_parent' => 0, 'current' => isset($_REQUEST['social_facebook_id']) && $_REQUEST['social_facebook_id'] == $account['social_facebook_id'], 'allow_nesting' => 0);
             }
         }
     }
 }
Ejemplo n.º 7
0
 function init()
 {
     $this->links = array();
     $this->module_name = "template";
     $this->module_position = 28;
     $this->version = 2.258;
     //2.258 - 2015-07-29 - delete template button
     //2.257 - 2015-04-23 - more template tags for emails
     //2.256 - 2015-01-09 - newline fix for template tags
     //2.255 - 2014-11-19 - improved template tag arithmetic
     //2.254 - 2014-11-19 - improved template tag arithmetic
     //2.253 - 2014-11-19 - improved template tag arithmetic
     //2.252 - 2014-09-28 - fix for showing available template tags under editor
     //2.251 - 2014-05-28 - more powerful if/else template tags
     //2.25 - 2014-05-25 - support for {CURRENCY:xxx} template tag
     //2.249 - 2014-05-20 - template defaults
     //2.248 - 2014-03-08 - date splitting in templates, eg: {DATE_FIELD-ymdYMDjlSWFn}
     //2.247 - 2014-02-10 - conditional logic improvement
     //2.246 - 2014-02-05 - new quote feature
     //2.245 - 2013-11-15 - working on new UI
     //2.244 - 2013-10-13 - basic conditional tags in templates {if:KEY}Hi {KEY}{endif:KEY}
     //2.243 - 2013-10-05 - settings page improvement
     //2.242 - 2013-10-02 - template creation fix
     //2.241 - 2013-09-12 - support for company specific templates
     //2.24 - 2013-09-02 - support for {l:Translate} language strings in templates
     //2.239 - 2013-08-30 - template speed improvement
     //2.238 - 2013-05-01 - template printing improvements
     //2.22 - wysiwyg edior error on creating new templates.
     //2.221 - perm fix
     //2.222 - sort by name instead of id
     //2.23 - editing templates from other settings pages in a popup
     //2.231 - new jquery version
     //2.232 - showing available template tags in template editor.
     //2.233 - speed improvements
     //2.234 - bug fix create new template
     //2.235 - support for basic arithmetic in template variables (+-) and dates (+1d-1m+2y)
     //2.236 - new 'external_template' template, used for all external layouts (jobs, tickets, invoices, etc..)
     //2.237 - css tweak
     // the link within Admin > Settings > templates.
     if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
         $this->links[] = array("name" => "Templates", "p" => "template", "icon" => "icon.png", "args" => array('template_id' => false), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0);
     }
 }
Ejemplo n.º 8
0
 public static function can_i($actions, $name = false, $category = false, $module = false)
 {
     $class_name = $module;
     if (!$module) {
         // php5.2 doesn't have get_called_class() :(
         if (function_exists('get_called_class')) {
             $class_name = get_called_class();
         } else {
             if (is_callable('self::get_class()')) {
                 eval('$class_name = self::get_class();');
             } else {
                 // doesn't work in php5.2
                 eval('$class_name = static::get_class();');
             }
         }
         if (!$class_name) {
             echo 'no class found - please upgrade to php5.3';
         }
     }
     if (!$name) {
         $name = ucwords(str_replace('_', ' ', str_replace('module_', '', $class_name)));
     }
     if (!$name) {
         return false;
     }
     if (!$category) {
         $category = ucwords(str_replace('_', ' ', str_replace('module_', '', $class_name)));
     }
     $perms = array('name' => $name, 'module' => str_replace('module_', '', $class_name), 'category' => $category, 'description' => 'Permissions');
     if (!is_array($actions)) {
         $actions = array($actions);
     }
     foreach ($actions as $action) {
         $perms[$action] = 1;
     }
     return module_security::has_feature_access($perms);
 }
Ejemplo n.º 9
0
 public function init()
 {
     $this->links = array();
     $this->map_types = array();
     $this->module_name = "map";
     $this->module_position = 14;
     $this->version = 2.21;
     //2.21 - 2015-09-10 - map marker fix
     //2.2 - 2015-09-09 - map marker fix
     //2.1 - 2015-06-10 - initial release
     // the link within Admin > Settings > Maps.
     if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
         $this->links[] = array("name" => "Maps", "p" => "map_settings", 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0);
     }
     if ($this->can_i('view', 'Maps') && module_config::c('enable_customer_maps', 1) && module_map::is_plugin_enabled()) {
         // only display if a customer has been created.
         if (isset($_REQUEST['customer_id']) && $_REQUEST['customer_id'] && $_REQUEST['customer_id'] != 'new') {
             // how many maps?
             $name = 'Maps';
             $this->links[] = array("name" => $name, "p" => "map_admin", 'args' => array('map_id' => false), 'holder_module' => 'customer', 'holder_module_page' => 'customer_admin_open', 'menu_include_parent' => 0, 'icon_name' => 'globe');
         }
         $this->links[] = array("name" => 'Maps', "p" => "map_admin", 'args' => array('map_id' => false), 'icon_name' => 'globe');
     }
 }
Ejemplo n.º 10
0
 public function pre_menu()
 {
     // the link within Admin > Settings > finances.
     if ($this->can_i('view', 'Finance') && self::is_enabled()) {
         $this->links[] = array("name" => "Finance", "p" => "finance", "args" => array('finance_id' => false), 'icon_name' => 'money');
     }
     if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view')) && self::is_enabled()) {
         $this->links[] = array("name" => "Finance", "p" => "finance_settings", "icon" => "icon.png", "args" => array('finance_id' => false), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0);
     }
 }
Ejemplo n.º 11
0
 public static function link_generate($file_id = false, $options = array(), $link_options = array())
 {
     $key = 'file_id';
     if ($file_id === false && $link_options) {
         foreach ($link_options as $link_option) {
             if (isset($link_option['data']) && isset($link_option['data'][$key])) {
                 ${$key} = $link_option['data'][$key];
                 break;
             }
         }
         if (!${$key} && isset($_REQUEST[$key])) {
             ${$key} = $_REQUEST[$key];
         }
     }
     $bubble_to_module = false;
     if (!isset($options['type'])) {
         $options['type'] = 'file';
     }
     $options['page'] = isset($options['page']) ? $options['page'] : 'file_admin';
     if (!isset($options['arguments'])) {
         $options['arguments'] = array();
     }
     $options['arguments']['file_id'] = $file_id;
     $options['module'] = 'file';
     if (isset($options['data'])) {
         $data = $options['data'];
     } else {
         $data = array();
         if ($file_id > 0) {
             $data = self::get_file($file_id);
         }
         $options['data'] = $data;
     }
     if (!isset($data['customer_id']) && isset($_REQUEST['customer_id']) && (int) $_REQUEST['customer_id']) {
         $data['customer_id'] = (int) $_REQUEST['customer_id'];
     }
     // what text should we display in this link?
     $options['text'] = !isset($data['file_name']) || !trim($data['file_name']) ? 'N/A' : $data['file_name'];
     if (isset($data['customer_id']) && $data['customer_id'] > 0) {
         $bubble_to_module = array('module' => 'customer', 'argument' => 'customer_id');
     }
     array_unshift($link_options, $options);
     if (!module_security::has_feature_access(array('name' => 'Customers', 'module' => 'customer', 'category' => 'Customer', 'view' => 1, 'description' => 'view'))) {
         $bubble_to_module = false;
         /*if(!isset($options['full']) || !$options['full']){
               return '#';
           }else{
               return isset($options['text']) ? $options['text'] : 'N/A';
           }*/
     }
     if ($bubble_to_module) {
         global $plugins;
         return $plugins[$bubble_to_module['module']]->link_generate(false, array(), $link_options);
     } else {
         // return the link as-is, no more bubbling or anything.
         // pass this off to the global link_generate() function
         return link_generate($link_options);
     }
 }
Ejemplo n.º 12
0
 public static function link_generate($invoice_id = false, $options = array(), $link_options = array())
 {
     // link generation can be cached and save a few db calls.
     $link_cache_key = 'invoice_link3_' . md5(module_security::get_loggedin_id() . '_' . serialize(func_get_args())) . '_' . (isset($_REQUEST['customer_id']) ? $_REQUEST['customer_id'] : false);
     $link_cache_timeout = module_config::c('cache_link_timeout', 3600);
     if ($cached_link = module_cache::get('invoice', $link_cache_key)) {
         return $cached_link;
     }
     $key = 'invoice_id';
     if ($invoice_id === false && $link_options) {
         foreach ($link_options as $link_option) {
             if (isset($link_option['data']) && isset($link_option['data'][$key])) {
                 ${$key} = $link_option['data'][$key];
                 break;
             }
         }
         if (!${$key} && isset($_REQUEST[$key])) {
             ${$key} = $_REQUEST[$key];
         }
     }
     $bubble_to_module = false;
     if (!isset($options['type'])) {
         $options['type'] = 'invoice';
     }
     if (!isset($options['page'])) {
         $options['page'] = 'invoice_admin';
     }
     if (!isset($options['arguments'])) {
         $options['arguments'] = array();
     }
     $options['arguments']['invoice_id'] = $invoice_id;
     $options['module'] = 'invoice';
     if (!isset($options['data']) || !$options['data']) {
         if ((int) $invoice_id > 0) {
             $data = self::get_invoice($invoice_id, 2);
         } else {
             $data = array();
         }
         $options['data'] = $data;
     } else {
         $data = $options['data'];
     }
     // todo - read total_amoutn_due from new c_ cached field
     if (!isset($data['total_amount_due'])) {
     } else {
         if (isset($data['date_cancel']) && $data['date_cancel'] != '0000-00-00') {
             $link_options['class'] = 'invoice_cancel';
         } else {
             if ($data['total_amount_due'] <= 0) {
                 $link_options['class'] = 'success_text';
             } else {
                 $link_options['class'] = 'error_text';
             }
         }
     }
     // what text should we display in this link?
     $options['text'] = !isset($data['name']) || !trim($data['name']) ? 'N/A' : $data['name'];
     if (self::can_i('edit', 'Invoices') && (isset($data['customer_id']) && $data['customer_id'] > 0 || isset($_REQUEST['customer_id']) && $_REQUEST['customer_id'] > 0)) {
         $bubble_to_module = array('module' => 'customer', 'argument' => 'customer_id');
     }
     array_unshift($link_options, $options);
     if (!module_security::has_feature_access(array('name' => 'Customers', 'module' => 'customer', 'category' => 'Customer', 'view' => 1, 'description' => 'view'))) {
         $bubble_to_module = false;
         /*
                     if(!isset($options['full']) || !$options['full']){
                         return '#';
                     }else{
                         return isset($options['text']) ? $options['text'] : 'N/A';
                     }*/
     }
     if ($bubble_to_module) {
         global $plugins;
         $link = $plugins[$bubble_to_module['module']]->link_generate(false, array(), $link_options);
     } else {
         // return the link as-is, no more bubbling or anything.
         // pass this off to the global link_generate() function
         //print_r($link_options);
         $link = link_generate($link_options);
     }
     module_cache::put('invoice', $link_cache_key, $link, $link_cache_timeout);
     return $link;
 }
Ejemplo n.º 13
0
 public static function link_generate($job_id = false, $options = array(), $link_options = array())
 {
     // link generation can be cached and save a few db calls.
     $cache_options = $options;
     if (isset($cache_options['data'])) {
         unset($cache_options['data']);
         $cache_options['data_name'] = isset($options['data']) && isset($options['data']['name']) ? $options['data']['name'] : '';
     }
     $cache_options['customer_id'] = isset($_REQUEST['customer_id']) ? $_REQUEST['customer_id'] : false;
     $cache_options['current_user'] = module_security::get_loggedin_id();
     $link_cache_key = 'job_link_' . $job_id . '_' . md5(serialize($cache_options));
     if ($cached_link = module_cache::get('job', $link_cache_key)) {
         return $cached_link;
     }
     $link_cache_timeout = module_config::c('cache_link_timeout', 3600);
     $key = 'job_id';
     if ($job_id === false && $link_options) {
         foreach ($link_options as $link_option) {
             if (isset($link_option['data']) && isset($link_option['data'][$key])) {
                 ${$key} = $link_option['data'][$key];
                 break;
             }
         }
         if (!${$key} && isset($_REQUEST[$key])) {
             ${$key} = $_REQUEST[$key];
         }
     }
     $bubble_to_module = false;
     if (!isset($options['type'])) {
         $options['type'] = 'job';
     }
     $options['page'] = 'job_admin';
     if (!isset($options['arguments'])) {
         $options['arguments'] = array();
     }
     $options['module'] = 'job';
     $data = array();
     if (isset($options['data'])) {
         $data = $options['data'];
     }
     if (isset($options['full']) && $options['full']) {
         // only hit database if we need to print a full link with the name in it.
         if (!isset($options['data']) || !$options['data']) {
             if ((int) $job_id > 0) {
                 $data = self::get_job($job_id, false, true);
             } else {
                 $data = array();
             }
             $options['data'] = $data;
         } else {
             $data = $options['data'];
         }
         // what text should we display in this link?
         $options['text'] = !isset($data['name']) || !trim($data['name']) ? _l('N/A') : $data['name'];
         if (!$data || !$job_id || isset($data['_no_access'])) {
             $link = $options['text'];
             module_cache::put('job', $link_cache_key, $link, $link_cache_timeout);
             return $link;
         }
     } else {
         if (isset($_REQUEST['customer_id']) && (int) $_REQUEST['customer_id'] > 0) {
             $data['customer_id'] = (int) $_REQUEST['customer_id'];
         }
     }
     $options['text'] = isset($options['text']) ? $options['text'] : '';
     // htmlspecialchars is done in link_generatE() function
     // generate the arguments for this link
     $options['arguments']['job_id'] = $job_id;
     if (isset($data['customer_id']) && $data['customer_id'] > 0) {
         $bubble_to_module = array('module' => 'customer', 'argument' => 'customer_id');
     }
     array_unshift($link_options, $options);
     if (!module_security::has_feature_access(array('name' => 'Customers', 'module' => 'customer', 'category' => 'Customer', 'view' => 1, 'description' => 'view'))) {
         $bubble_to_module = false;
         /*
         if(!isset($options['full']) || !$options['full']){
             return '#';
         }else{
             return isset($options['text']) ? $options['text'] : _l('N/A');
         }
         */
     }
     if ($bubble_to_module) {
         global $plugins;
         $link = $plugins[$bubble_to_module['module']]->link_generate(false, array(), $link_options);
     } else {
         // return the link as-is, no more bubbling or anything.
         // pass this off to the global link_generate() function
         $link = link_generate($link_options);
     }
     module_cache::put('job', $link_cache_key, $link, $link_cache_timeout);
     return $link;
 }
Ejemplo n.º 14
0
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
    die('no permissions');
}
$ips = array();
hook_handle_callback('layout_column_half', 1);
?>


            <h3><?php 
_e('Login History');
?>
</h3>

            <p>Below is a list of which users have logged into the system.</p>

            <table class="tableclass tableclass_rows tableclass_full">
                <thead>
                <tr>
                    <th>
                        Date/Time
Ejemplo n.º 15
0
 public static function link_generate($newsletter_id = false, $options = array(), $link_options = array(), $data = false)
 {
     $key = 'newsletter_id';
     if ($newsletter_id === false && $link_options) {
         foreach ($link_options as $link_option) {
             if (isset($link_option['data']) && isset($link_option['data'][$key])) {
                 ${$key} = $link_option['data'][$key];
                 break;
             }
         }
         if (!${$key} && isset($_REQUEST[$key])) {
             ${$key} = $_REQUEST[$key];
         }
     }
     $bubble_to_module = false;
     if (!isset($options['type'])) {
         $options['type'] = 'newsletter';
     }
     if (!isset($options['arguments'])) {
         $options['arguments'] = array();
     }
     $options['arguments']['newsletter_id'] = $newsletter_id;
     $options['module'] = 'newsletter';
     $data = isset($options['data']) ? $options['data'] : array();
     if (isset($options['full']) && $options['full']) {
         if (!$data) {
             $data = self::get_newsletter($newsletter_id);
         }
         $options['data'] = $data;
     }
     // what text should we display in this link?
     if (!isset($options['text']) || !$options['text']) {
         $options['text'] = !isset($data['subject']) || !trim($data['subject']) ? 'N/A' : $data['subject'];
     }
     if (!$link_options) {
         // only bubble up once to this same module.
         //$options['page'] = 'newsletter_edit';
         if (!isset($options['page'])) {
             $options['page'] = 'newsletter_edit';
         }
         $bubble_to_module = array('module' => 'newsletter');
     } else {
         // for first loop
         $options['page'] = 'newsletter_admin';
     }
     array_unshift($link_options, $options);
     if (!module_security::has_feature_access(array('name' => 'Newsletters', 'module' => 'newsletter', 'category' => 'Newsletter', 'view' => 1, 'description' => 'view'))) {
         if (!isset($options['full']) || !$options['full']) {
             return '#';
         } else {
             return isset($options['text']) ? $options['text'] : 'N/A';
         }
     }
     if ($bubble_to_module) {
         global $plugins;
         return $plugins[$bubble_to_module['module']]->link_generate(false, array(), $link_options);
     } else {
         // return the link as-is, no more bubbling or anything.
         // pass this off to the global link_generate() function
         return link_generate($link_options);
     }
 }
Ejemplo n.º 16
0
 public static function link_generate($ticket_id = false, $options = array(), $link_options = array())
 {
     $key = 'ticket_id';
     if ($ticket_id === false && $link_options) {
         foreach ($link_options as $link_option) {
             if (isset($link_option['data']) && isset($link_option['data'][$key])) {
                 ${$key} = $link_option['data'][$key];
                 break;
             }
         }
         if (!${$key} && isset($_REQUEST[$key])) {
             ${$key} = $_REQUEST[$key];
         }
     }
     $bubble_to_module = false;
     if (!isset($options['type'])) {
         $options['type'] = 'ticket';
     }
     if (!isset($options['page'])) {
         $options['page'] = 'ticket_admin';
     }
     if (!isset($options['arguments'])) {
         $options['arguments'] = array();
     }
     $options['arguments']['ticket_id'] = $ticket_id;
     $options['module'] = 'ticket';
     // what text should we display in this link?
     if ($options['page'] == 'ticket_settings_fields') {
         if (isset($options['data']) && $options['data']) {
             //$options['data'] = $options['data'];
         } else {
             $data = self::get_ticket_extras_key($ticket_id);
             $options['data'] = $data;
         }
         $options['text'] = isset($options['data']['key']) ? $options['data']['key'] : '';
         array_unshift($link_options, $options);
         $options['page'] = 'ticket_settings';
         // bubble back onto ourselves for the link.
         return self::link_generate($ticket_id, $options, $link_options);
     } else {
         if ($options['page'] == 'ticket_settings_types') {
             if (isset($options['data']) && $options['data']) {
                 //$options['data'] = $options['data'];
             } else {
                 $data = self::get_ticket_type($ticket_id);
                 $options['data'] = $data;
             }
             $options['text'] = isset($options['data']['name']) ? $options['data']['name'] : '';
             array_unshift($link_options, $options);
             $options['page'] = 'ticket_settings';
             // bubble back onto ourselves for the link.
             return self::link_generate($ticket_id, $options, $link_options);
         } elseif ($options['page'] == 'ticket_settings_accounts') {
             if (isset($options['data']) && $options['data']) {
                 //$options['data'] = $options['data'];
             } else {
                 $data = self::get_ticket_account($ticket_id);
                 $options['data'] = $data;
             }
             $options['text'] = $options['data']['name'];
             array_unshift($link_options, $options);
             $options['page'] = 'ticket_settings';
             // bubble back onto ourselves for the link.
             return self::link_generate($ticket_id, $options, $link_options);
         } else {
             if (isset($options['data']) && $options['data']) {
                 //$options['data'] = $options['data'];
             } else {
                 $data = self::get_ticket($ticket_id);
                 $options['data'] = $data;
                 $options['class'] = 'error';
             }
             $options['text'] = $ticket_id ? self::ticket_number($ticket_id) : 'N/A';
         }
     }
     array_unshift($link_options, $options);
     if ($options['page'] == 'ticket_admin' && $options['data'] && isset($options['data']['status_id'])) {
         // pick the class name for the error. or ticket status
         $link_options['class'] = 'ticket_status_' . $options['data']['status_id'];
     }
     if (self::can_i('edit', 'Ticket Settings') && $options['page'] == 'ticket_settings') {
         $bubble_to_module = array('module' => 'config');
     } else {
         if ((!isset($_GET['customer_id']) || !$_GET['customer_id']) && class_exists('module_faq', false) && (module_config::c('ticket_separate_product_queue', 0) || module_config::c('ticket_separate_product_menu', 0))) {
         } else {
             if ($options['data']['customer_id'] > 0) {
                 if (!module_security::has_feature_access(array('name' => 'Customers', 'module' => 'customer', 'category' => 'Customer', 'view' => 1, 'description' => 'view'))) {
                     /*if(!isset($options['full']) || !$options['full']){
                           return '#';
                       }else{
                           return isset($options['text']) ? $options['text'] : 'N/A';
                       }*/
                 } else {
                     $bubble_to_module = array('module' => 'customer', 'argument' => 'customer_id');
                 }
             }
         }
     }
     if ($bubble_to_module) {
         global $plugins;
         return $plugins[$bubble_to_module['module']]->link_generate(false, array(), $link_options);
     } else {
         // return the link as-is, no more bubbling or anything.
         // pass this off to the global link_generate() function
         return link_generate($link_options);
     }
 }