diff --git a/include/class.config.php b/include/class.config.php index 04a7cea4546bdf65430034564fd3d2812a5fc50a..3683399be0e6f0f0a7d37785c9ed89f4c2447f1a 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -214,6 +214,10 @@ class OsticketConfig extends Config { return ($this->get('enable_kb') && FAQ::countPublishedFAQs()); } + function isCannedResponseEnabled() { + return $this->get('enable_premade'); + } + function getVersion() { return THIS_VERSION; } diff --git a/include/class.nav.php b/include/class.nav.php index bc4956f084b4b810b17d242637f38bcc365bbee8..1c721b8542cf6571ca58a789f152bab8506c3ac2 100644 --- a/include/class.nav.php +++ b/include/class.nav.php @@ -125,6 +125,7 @@ class StaffNav { } function getSubMenus(){ //Private. + global $cfg; $staff = $this->staff; $submenus=array(); @@ -163,7 +164,7 @@ class StaffNav { if($staff) { if($staff->canManageFAQ()) $subnav[]=array('desc'=>__('Categories'),'href'=>'categories.php','iconclass'=>'faq-categories'); - if($staff->canManageCannedResponses()) + if ($cfg->isCannedResponseEnabled() && $staff->canManageCannedResponses()) $subnav[]=array('desc'=>__('Canned Responses'),'href'=>'canned.php','iconclass'=>'canned'); } break; diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index aa13be27640df493c1337edb7a883393f331d566..23ab4b0cb19c2ada6373befe1895e439fd192775 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -534,6 +534,7 @@ $tcount+= $ticket->getNumNotes(); <label><strong><?php echo __('Response');?>:</strong></label> </td> <td> +<?php if ($cfg->isCannedResponseEnabled()) { ?> <select id="cannedResp" name="cannedResp"> <option value="0" selected="selected"><?php echo __('Select a canned response');?></option> <option value='original'><?php echo __('Original Message'); ?></option> @@ -548,7 +549,7 @@ $tcount+= $ticket->getNumNotes(); ?> </select> <br> - <?php +<?php } # endif (canned-resonse-enabled) $signature = ''; switch ($thisstaff->getDefaultSignatureType()) { case 'dept': diff --git a/scp/canned.php b/scp/canned.php index 5de2f87b50e128d08c615275f9c6e2e25b5d14e8..b44b4067f5757e6a6e07ad8a6473ddc9eb4b6bd1 100644 --- a/scp/canned.php +++ b/scp/canned.php @@ -17,7 +17,8 @@ require('staff.inc.php'); include_once(INCLUDE_DIR.'class.canned.php'); /* check permission */ -if(!$thisstaff || !$thisstaff->canManageCannedResponses()) { +if(!$thisstaff || !$thisstaff->canManageCannedResponses() + || !$cfg->isCannedResponseEnabled()) { header('Location: kb.php'); exit; }