diff --git a/include/ajax.tips.php b/include/ajax.tips.php index 2b6fdab3d340347e8aee4160b15782876838ea30..3b2a1d19a565fe7d812df9920857c9589c89f6b5 100644 --- a/include/ajax.tips.php +++ b/include/ajax.tips.php @@ -21,12 +21,24 @@ require_once(INCLUDE_DIR.'class.i18n.php'); class HelpTipAjaxAPI extends AjaxController { function getTipsJson($namespace, $lang='en_US') { + global $ost; + $i18n = new Internationalization($lang); $tips = $i18n->getTemplate("help/tips/$namespace.yaml"); if (!$tips || !($data = $tips->getData())) Http::response(404, 'Help content not available'); + // Translate links to the root path of this installation + foreach ($data as $tip=>&$info) { + $info = $ost->replaceTemplateVariables($info, array( + 'config'=>$ost->getConfig())); + if (isset($info['links'])) + foreach ($info['links'] as &$l) + if ($l['href'][0] == '/') + $l['href'] = ROOT_PATH.substr($l['href'],1); + } + return $this->json_encode($data); } diff --git a/include/class.config.php b/include/class.config.php index ed98ec0e439594066699dd18533fa77140c61970..1df9cc4db13e331129102e8941e675e93c3db79a 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -733,6 +733,10 @@ class OsticketConfig extends Config { return $this->get('upload_dir'); } + function getVar($name) { + return $this->get($name); + } + function updateSettings($vars, &$errors) { if(!$vars || $errors) diff --git a/include/i18n/en_US/help/tips/settings.alerts.yaml b/include/i18n/en_US/help/tips/settings.alerts.yaml new file mode 100644 index 0000000000000000000000000000000000000000..19fb979c9b472557ec09a9a3b51920afe422be4b --- /dev/null +++ b/include/i18n/en_US/help/tips/settings.alerts.yaml @@ -0,0 +1,71 @@ +# +# This is popup help messages for the Admin Panel -> Settings -> System page +# +# Fields: +# title - Shown in bold at the top of the popover window +# content - The body of the help popover +# links - List of links shows below the content +# title - Link title +# href - href of link (links starting with / are translated to the +# helpdesk installation path) +# +# The key names such as 'helpdesk_name' should not be translated as they +# must match the HTML #ids put into the page template. +# +--- +new_ticket: + title: New Ticket Alert + content: > + Alert sent out to staff members when new tickets are created in the + system. + links: + - title: Default New Ticket Alert Template + href: /scp/templates.php?default_for=ticket.alert + +new_message: + title: New Message Alert + content: > + Alert sent out when a new message, from the user, is appended to an + existing ticket + links: + - title: Default New Message Alert Template + href: /scp/templates.php?default_for=message.alert + +new_activity: + title: New Internal Note Alert + content: > + Alert sent out when a new internal note is posted + links: + - title: Default Ticket Activity Template + href: /scp/templates.php?default_for=note.alert + +assign_alert: + title: Alert on Assignment + content: > + Alert sent out to staff on ticket assignment + links: + - title: Default Ticket Assignment Alert Template + href: /scp/templates.php?default_for=assigned.alert + +transfer_alert: + title: Alert on Transfer + content: > + Alert sent out to staff of the target department on ticket transfer + links: + - title: Default Ticket Transfer Alert Template + href: /scp/templates.php?default_for=transfer.alert + +stale_alert: + title: Alert on Stale Ticket + content: > + Alert sent out when a ticket becomes overdue - admin email gets an + alert by default + links: + - title: Default Stale Ticket Alert Template + href: /scp/templates.php?default_for=ticket.overdue + +meltdowns: + title: System Errors + content: > + Enabled by default. Errors are sent to system admin email + (%{config.admin_email}) diff --git a/include/i18n/en_US/help/tips/settings.autoresponder.yaml b/include/i18n/en_US/help/tips/settings.autoresponder.yaml new file mode 100644 index 0000000000000000000000000000000000000000..89f0d6faf51216be6524299bbc8fe7711cb894c1 --- /dev/null +++ b/include/i18n/en_US/help/tips/settings.autoresponder.yaml @@ -0,0 +1,50 @@ +# +# This is popup help messages for the Admin Panel -> Settings -> System page +# +# Fields: +# title - Shown in bold at the top of the popover window +# content - The body of the help popover +# links - List of links shows below the content +# title - Link title +# href - href of link (links starting with / are translated to the +# helpdesk installation path) +# +# The key names such as 'helpdesk_name' should not be translated as they +# must match the HTML #ids put into the page template. +# +--- +new_ticket: + title: New Ticket Auto-Response + content: > + Autoresponse includes the ticket ID required to check status of the + ticket + links: + - title: Default New Ticket Autoresponse Template + href: /scp/templates.php?default_for=ticket.autoresp + +new_staff_ticket: + title: New Ticket by Staff Auto-Response + content: > + Notice sent when staff creates a ticket on behalf of the user. + <em>Staff can override this when creating new tickets</em> + links: + - title: Default New Ticket by Staff Autoresponse Template + href: /scp/templates.php?default_for=ticket.notice + +new_message: + title: New Message Confirmation + content: > + Confirmation notice sent when a new message is appended to an + existing ticket + links: + - title: Default New Message Confirmation Template + href: /scp/templates.php?default_for=message.autoresp + +overlimit_notice: + title: Overlimit Notice + content: > + Ticket denied notice sent to user on limit violation. Admin gets + alerts on <em>ALL</em> denials by default + links: + - title: Default Overlimit Notice Template + href: /scp/templates.php?default_for=ticket.overlimit diff --git a/include/i18n/en_US/help/tips/settings.email.yaml b/include/i18n/en_US/help/tips/settings.email.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fa3ddc043919d4de30038208d9eb588097b7f39b --- /dev/null +++ b/include/i18n/en_US/help/tips/settings.email.yaml @@ -0,0 +1,83 @@ +# +# This is popup help messages for the Admin Panel -> Settings -> System page +# +# Fields: +# title - Shown in bold at the top of the popover window +# content - The body of the help popover +# links - List of links shows below the content +# title - Link title +# href - href of link (links starting with / are translated to the +# helpdesk installation path) +# +# The key names such as 'helpdesk_name' should not be translated as they +# must match the HTML #ids put into the page template. +# +--- +default_templates: + title: Default Email Templates + content: > + Set of templates that will be utilized for Alerts & Notices to + staff as well as Auto-Responses to clients during the actions in a + ticket’s life cycle. Templates can be created in Admin Panel > + Emails > Templates + links: + - title: Email Templates + href: /scp/templates.php + +default_email: + title: Default System Email + content: > + Set the system email address that auto-responses that clients will + be shown emails are from if not set by Department + links: + - title: System Email Addresses + href: /scp/emails.php + +default_alert_email: + title: Default Alert Email + content: > + Set the email address that Alerts & Notices to staff will be + shown as received from if no default is set by Department (Admin + Panel > Staff > Department) or by Help Topic (Admin Panel > + Manage > Help Topic) + links: + - title: System Email Addresses + href: /scp/emails.php + +admin_email: + title: Administrative Contact + content: > + Set the address for the Helpdesk Administrator to receive notices of + the System Error Log as well as the New Ticket Alerts (if enabled at + Admin Panel > Settings > Alerts & Notices > New Ticket + Alert) + links: + - title: Alerts & Notices + href: /scp/settings.php?t=alerts + +# Incoming emails section +incoming_email: + title: Incoming Email Settings + content: > + Allow IMAP/POP polling once you have set up the information in + emails section of Admin Panel. You can also edit the reply separator + text.<br/><br/> + <em>For mail polling to work you must set an external cron job or + enable auto-cron polling</em> + +enable_email_poll: + title: Enable Email Polling + content: > + Allow IMAP/POP polling once you have set up the information in + emails section of Admin Panel. You can also edit the reply separator + text + +enable_autocron_poll: + title: Poll Email using Auto-cron + content: > + <em><b>Not Recommended</b></em><br/><br/> + Enables fetching email periodically using the automatic cron system. + As admin and staff members interact with the system, the system will + periodically run cleanup routines called the auto-cron. This setting + enables fetching email during this cleanup. + diff --git a/include/i18n/en_US/help/tips/settings.system.yaml b/include/i18n/en_US/help/tips/settings.system.yaml index 7e8e1d309d68b0a213c8a0b9894b6d5f277d5b42..ceb6147f8f14f4d71702c8bce5211ab235cf27bb 100644 --- a/include/i18n/en_US/help/tips/settings.system.yaml +++ b/include/i18n/en_US/help/tips/settings.system.yaml @@ -4,6 +4,10 @@ # Fields: # title - Shown in bold at the top of the popover window # content - The body of the help popover +# links - List of links shows below the content +# title - Link title +# href - href of link (links starting with / are translated to the +# helpdesk installation path) # # The key names such as 'helpdesk_name' should not be translated as they # must match the HTML #ids put into the page template. @@ -11,13 +15,74 @@ --- helpdesk_status: title: Helpdesk Status - content: | + content: > Enables the client portal and the staff interface. If this option is disabled, then only staff marked as <b>Admins</b> will be able to access the helpdesk. helpdesk_url: title: Helpdesk URL - content: | + content: > This URL is the base of your osTicket installation. It is used in email communication to direct end users back to your helpdesk. + +helpdesk_name: + title: Helpdesk Name + content: > + Name that will appear in the browser tab when at your client + interface. If your help desk page is bookmarked, this will be the + title/name of the site page + +default_dept: + title: Default Department + content: > + Determines the default department for tickets submitted that do not + have a department auto-assigned by help topic or incoming email + links: + - title: Manage Departments + href: /scp/departments.php + +page_size: + title: Default Page Size + content: > + This determines the number of tickets per page on the ticket view + (Staff Panel > Tickets). This can be defined in the + "My Preferences" for each staff member + +log_level: + title: Default Log Level + content: > + Determines the level of issues that will be saved in the system log + including, excess log-ins, denied tickets, etc. + +log_purge: + title: Purge Logs + content: > + Length, in months, you would like to keep the system log activity + for viewing on the System Logs page. + +name_format: + title: Default Name Format + content: > + Formatting technique used to format names throughout the system. + Email templates will use the format for names of no other format is + specified in the place holder. + +# Authentication settings +password_reset: + title: Password Expiration Policy + content: > + Sets the requirement for how often (in months) staff will be + required to reset their password. + +# Date and time options +date_and_time: + title: Localized Date Formats + content: > + Set up the format for the client’s Date & Time. To set time/date + for staff, go to Admin Panel > Staff > select staff profile to edit + links: + - title: PHP date() formats + href: "http://php.net/date" + - title: Your preferences + href: /scp/profile.php diff --git a/include/staff/settings-alerts.inc.php b/include/staff/settings-alerts.inc.php index cc91ffdf804fce3dad988a6e11139a1b259d60c8..0ab5cb689367ca713400a67af17613d261eec4b8 100644 --- a/include/staff/settings-alerts.inc.php +++ b/include/staff/settings-alerts.inc.php @@ -11,7 +11,9 @@ </tr> </thead> <tbody> - <tr><th><em><b>New Ticket Alert</b>: Alert sent out on new tickets</em></th></tr> + <tr><th><em><b>New Ticket Alert</b>: + <i class="help-tip icon-question-sign" href="#new_ticket"></i> + </em></th></tr> <tr> <td><em><b>Status:</b></em> <input type="radio" name="ticket_alert_active" value="1" <?php echo $config['ticket_alert_active']?'checked':''; ?> />Enable @@ -34,7 +36,9 @@ <input type="checkbox" name="ticket_alert_dept_members" <?php echo $config['ticket_alert_dept_members']?'checked':''; ?>> Department Members <em>(spammy)</em> </td> </tr> - <tr><th><em><b>New Message Alert</b>: Alert sent out when a new message, from the user, is appended to an existing ticket</em></th></tr> + <tr><th><em><b>New Message Alert</b>: + <i class="help-tip icon-question-sign" href="#new_message"></i> + </em></th></tr> <tr> <td><em><b>Status:</b></em> <input type="radio" name="message_alert_active" value="1" <?php echo $config['message_alert_active']?'checked':''; ?> />Enable @@ -57,7 +61,9 @@ <input type="checkbox" name="message_alert_dept_manager" <?php echo $config['message_alert_dept_manager']?'checked':''; ?>> Department Manager <em>(spammy)</em> </td> </tr> - <tr><th><em><b>New Internal Note Alert</b>: Alert sent out when a new internal note is posted.</em></th></tr> + <tr><th><em><b>New Internal Note Alert</b>: + <i class="help-tip icon-question-sign" href="#new_activity"></i> + </em></th></tr> <tr> <td><em><b>Status:</b></em> <input type="radio" name="note_alert_active" value="1" <?php echo $config['note_alert_active']?'checked':''; ?> />Enable @@ -81,7 +87,9 @@ <input type="checkbox" name="note_alert_dept_manager" <?php echo $config['note_alert_dept_manager']?'checked':''; ?>> Department Manager <em>(spammy)</em> </td> </tr> - <tr><th><em><b>Ticket Assignment Alert</b>: Alert sent out to staff on ticket assignment.</em></th></tr> + <tr><th><em><b>Ticket Assignment Alert</b>: + <i class="help-tip icon-question-sign" href="#assign_alert"></i> + </em></th></tr> <tr> <td><em><b>Status: </b></em> <input name="assigned_alert_active" value="1" checked="checked" type="radio">Enable @@ -106,7 +114,9 @@ Team Members <em>(spammy)</em> </td> </tr> - <tr><th><em><b>Ticket Transfer Alert</b>: Alert sent out to staff of the target department on ticket transfer.</em></th></tr> + <tr><th><em><b>Ticket Transfer Alert</b>: + <i class="help-tip icon-question-sign" href="#transfer_alert"></i> + </em></th></tr> <tr> <td><em><b>Status:</b></em> <input type="radio" name="transfer_alert_active" value="1" <?php echo $config['transfer_alert_active']?'checked':''; ?> />Enable @@ -130,7 +140,9 @@ Department Members <em>(spammy)</em> </td> </tr> - <tr><th><em><b>Overdue Ticket Alert</b>: Alert sent out when a ticket becomes overdue - admin email gets an alert by default.</em></th></tr> + <tr><th><em><b>Overdue Ticket Alert</b>: + <i class="help-tip icon-question-sign" href="#stale_alert"></i> + </em></th></tr> <tr> <td><em><b>Status:</b></em> <input type="radio" name="overdue_alert_active" value="1" <?php echo $config['overdue_alert_active']?'checked':''; ?> />Enable @@ -153,7 +165,9 @@ <input type="checkbox" name="overdue_alert_dept_members" <?php echo $config['overdue_alert_dept_members']?'checked':''; ?>> Department Members <em>(spammy)</em> </td> </tr> - <tr><th><em><b>System Alerts</b>: Enabled by default. Errors are sent to system admin email (<?php echo $cfg->getAdminEmail(); ?>)</em></th></tr> + <tr><th><em><b>System Alerts</b>: + <i class="help-tip icon-question-sign" href="#meltdowns"></i> + </em></th></tr> <tr> <td> <input type="checkbox" name="send_sys_errors" checked="checked" disabled="disabled">System Errors diff --git a/include/staff/settings-autoresp.inc.php b/include/staff/settings-autoresp.inc.php index 0ad893b3fb97c4515ca407e9318a164cdc37454e..9123164c6a972a28a0e1a8a07a3d3de9a6b7f90e 100644 --- a/include/staff/settings-autoresp.inc.php +++ b/include/staff/settings-autoresp.inc.php @@ -18,8 +18,8 @@ <td> <input type="radio" name="ticket_autoresponder" value="1" <?php echo $config['ticket_autoresponder']?'checked="checked"':''; ?> /><b>Enable</b> <input type="radio" name="ticket_autoresponder" value="0" <?php echo !$config['ticket_autoresponder']?'checked="checked"':''; ?> />Disable - - <em>(Autoresponse includes the ticket ID required to check status of the ticket)</em> + + <i class="help-tip icon-question-sign" href="#new_ticket"></i> </td> </tr> <tr> @@ -27,8 +27,8 @@ <td> <input type="radio" name="ticket_notice_active" value="1" <?php echo $config['ticket_notice_active']?'checked="checked"':''; ?> /><b>Enable</b> <input type="radio" name="ticket_notice_active" value="0" <?php echo !$config['ticket_notice_active']?'checked="checked"':''; ?> />Disable - - <em>(Notice sent when staff creates a ticket on behalf of the user (Staff can override))</em> + + <i class="help-tip icon-question-sign" href="#new_staff_ticket"></i> </td> </tr> <tr> @@ -36,8 +36,8 @@ <td> <input type="radio" name="message_autoresponder" value="1" <?php echo $config['message_autoresponder']?'checked="checked"':''; ?> /><b>Enable</b> <input type="radio" name="message_autoresponder" value="0" <?php echo !$config['message_autoresponder']?'checked="checked"':''; ?> />Disable - - <em>(Confirmation notice sent when a new message is appended to an existing ticket)</em> + + <i class="help-tip icon-question-sign" href="#new_message"></i> </td> </tr> <tr> @@ -45,8 +45,8 @@ <td> <input type="radio" name="overlimit_notice_active" value="1" <?php echo $config['overlimit_notice_active']?'checked="checked"':''; ?> /><b>Enable</b> <input type="radio" name="overlimit_notice_active" value="0" <?php echo !$config['overlimit_notice_active']?'checked="checked"':''; ?> />Disable - - <em>(Ticket denied notice sent to user on limit violation. Admin gets alerts on ALL denials by default)</em> + + <i class="help-tip icon-question-sign" href="#overlimit_notice"></i> </td> </tr> </tbody> diff --git a/include/staff/settings-emails.inc.php b/include/staff/settings-emails.inc.php index f8b96f04b345ef4ecf8d6f80847da53f48a5f2fb..0ccbb959046a34b867ef68c324dc8adeffa3b18d 100644 --- a/include/staff/settings-emails.inc.php +++ b/include/staff/settings-emails.inc.php @@ -30,6 +30,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) } } ?> </select> <font class="error">* <?php echo $errors['default_template_id']; ?></font> + <i class="help-tip icon-question-sign" href="#default_templates"></i> </td> </tr> <tr> @@ -49,6 +50,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) } ?> </select> <font class="error">* <?php echo $errors['default_email_id']; ?></font> + <i class="help-tip icon-question-sign" href="#default_email"></i> </td> </tr> <tr> @@ -68,6 +70,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) } ?> </select> <font class="error">* <?php echo $errors['alert_email_id']; ?></font> + <i class="help-tip icon-question-sign" href="#default_alert_email"></i> </td> </tr> <tr> @@ -75,16 +78,21 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) <td> <input type="text" size=40 name="admin_email" value="<?php echo $config['admin_email']; ?>"> <font class="error">* <?php echo $errors['admin_email']; ?></font> - <em>(System administrator's email)</em> + <i class="help-tip icon-question-sign" href="#admin_email"></i> </td> </tr> - <tr><th colspan=2><em><strong>Incoming Emails</strong>: For mail fetcher (polling) to work you must set an external cron job or enable auto-cron polling</em></th> + <tr><th colspan=2><em><strong>Incoming Emails:</strong> + <i class="help-tip icon-question-sign" href="#incoming_email"></i> + </em></th> <tr> <td width="180">Email Polling:</td> <td><input type="checkbox" name="enable_mail_polling" value=1 <?php echo $config['enable_mail_polling']? 'checked="checked"': ''; ?> > Enable POP/IMAP polling - + + <i class="help-tip icon-question-sign" href="#enable_email_poll"></i> + <input type="checkbox" name="enable_auto_cron" <?php echo $config['enable_auto_cron']?'checked="checked"':''; ?>> - Poll on auto-cron <em>(Poll based on staff activity - NOT recommended)</em> + Poll on auto-cron + <i class="help-tip icon-question-sign" href="#enable_autocron_poll"></i> </td> </tr> <tr> diff --git a/include/staff/settings-system.inc.php b/include/staff/settings-system.inc.php index 09980c2c5e4bfbc657ef9a764b81287ed4c23ca9..077a9130ec3b72fa5c713d74fa613edf27f6d66a 100644 --- a/include/staff/settings-system.inc.php +++ b/include/staff/settings-system.inc.php @@ -38,7 +38,9 @@ $gmtime = Misc::gmtime(); <tr> <td width="220" class="required">Helpdesk Name/Title:</td> <td><input type="text" size="40" name="helpdesk_title" value="<?php echo $config['helpdesk_title']; ?>"> - <font class="error">* <?php echo $errors['helpdesk_title']; ?></font></td> + <font class="error">* <?php echo $errors['helpdesk_title']; ?></font> + <i class="help-tip icon-question-sign" href="#helpdesk_name"></i> + </td> </tr> <tr> <td width="220" class="required">Default Department:</td> @@ -55,6 +57,7 @@ $gmtime = Misc::gmtime(); } } ?> </select> <font class="error">* <?php echo $errors['default_dept_id']; ?></font> + <i class="help-tip icon-question-sign" href="#default_dept"></i> </td> </tr> @@ -69,6 +72,7 @@ $gmtime = Misc::gmtime(); <?php } ?> </select> + <i class="help-tip icon-question-sign" href="#page_size"></i> </td> </tr> <tr> @@ -81,6 +85,7 @@ $gmtime = Misc::gmtime(); <option value=1 <?php echo $config['log_level'] == 1 ? 'selected="selected"':''; ?>> ERROR</option> </select> <font class="error"> <?php echo $errors['log_level']; ?></font> + <i class="help-tip icon-question-sign" href="#log_level"></i> </td> </tr> <tr> @@ -96,6 +101,7 @@ $gmtime = Misc::gmtime(); <?php } ?> </select> + <i class="help-tip icon-question-sign" href="#purge_logs"></i> </td> </tr> <tr> @@ -109,6 +115,7 @@ $gmtime = Misc::gmtime(); ?>><?php echo $desc; ?></option> <?php } ?> </select> + <i class="help-tip icon-question-sign" href="#name_format"></i> </td> </tr> <tr> @@ -127,7 +134,8 @@ $gmtime = Misc::gmtime(); } ?> </select> - <font class="error"> <?php echo $errors['passwd_reset_period']; ?></font> + <font class="error"><?php echo $errors['passwd_reset_period']; ?></font> + <i class="help-tip icon-question-sign" href="#password_reset"></i> </td> </tr> <tr><td>Allow Password Resets:</th> @@ -204,7 +212,9 @@ $gmtime = Misc::gmtime(); </tr> <tr> <th colspan="2"> - <em><b>Date and Time Options</b>: Please refer to <a href="http://php.net/date" target="_blank">PHP Manual</a> for supported parameters.</em> + <em><b>Date and Time Options</b> + <i class="help-tip icon-question-sign" href="#date_and_time"></i> + </em> </th> </tr> <tr><td width="220" class="required">Time Format:</td> diff --git a/scp/css/scp.css b/scp/css/scp.css index 8016dcfc4ddd2d5e87a1e53cafaee693799e1417..39aea6899f1357637c3fa1a047c9c33112aca5a1 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -951,7 +951,7 @@ h2 .reload { display:block; position:absolute; top:5px; - left:-11px; + left:-12px; width:12px; z-index:700; } @@ -973,7 +973,18 @@ h2 .reload { position:absolute; top:0; left:-1px; - min-width:300px; + min-width:400px; + line-height: 1.15rem; +} + +.tip_content .links { + margin-top: 0.7em; + padding-top: 0.4em; + border-top: 1px solid #ddd; +} + +.tip_content .links a { + color: #548dd4; } .tip_content hr { @@ -989,9 +1000,8 @@ h2 .reload { .tip_close { position:absolute; - left:100%; - top:0; - margin-left:-12px; + top:0.3em; + right:0.5em; } .tip_shadow { @@ -1066,6 +1076,7 @@ h2 .reload { margin-bottom: 0.5em; padding-bottom: 0.2em; border-bottom: 1px solid #ddd; + padding-right: 1.5em; } i.help-tip { diff --git a/scp/js/tips.js b/scp/js/tips.js index e94c2182e962ea9f1ce279c13b156a32aef0fa0b..bb862e8b9710217b4e3221639db1481d6385f7a2 100644 --- a/scp/js/tips.js +++ b/scp/js/tips.js @@ -82,7 +82,7 @@ jQuery(function() { tip_box = $('<div>') .addClass('tip_box'), tip_content = $('<div>') - .append('<a href="#" class="tip_close">x</a>') + .append('<a href="#" class="tip_close"><i class="icon-remove-circle"></i></a>') .addClass('tip_content'), the_tip = tip_box .append(tip_arrow) @@ -108,8 +108,24 @@ jQuery(function() { return; } tip_content.append( - $('<h1>').append(section.title)) - .append(section.content); + $('<h1>') + .append('<i class="icon-info-sign faded"> ') + .append(section.title) + ).append(section.content); + if (section.links) { + var links = $('<div class="links">'); + $.each(section.links, function(i,l) { + var icon = l.href.match(/^http/) + ? 'icon-external-link' : 'icon-share-alt'; + links.append($('<div>') + .append($('<a>') + .html(l.title) + .prepend('<i class="'+icon+'"></i> ') + .attr('href', l.href).attr('target','_blank')) + ); + }); + tip_content.append(links); + } }); $('.tip_shadow', the_tip).css({ "height":the_tip.height() + 5 diff --git a/scp/templates.php b/scp/templates.php index 2b46e927bc150975162f7bcbe0a9c4734e4b9ef0..a475e5dca68d377b2bee15d77806ca302c939071 100644 --- a/scp/templates.php +++ b/scp/templates.php @@ -22,6 +22,13 @@ if($_REQUEST['tpl_id'] && elseif($_REQUEST['id'] && !($template=EmailTemplate::lookup($_REQUEST['id']))) $errors['err']='Unknown or invalid template ID.'; +elseif($_REQUEST['default_for']) { + $sql = 'SELECT id FROM '.EMAIL_TEMPLATE_TABLE + .' WHERE tpl_id='.db_input($cfg->getDefaultTemplateId()) + .' AND code_name='.db_input($_REQUEST['default_for']); + if ($id = db_result(db_query($sql))) + Http::redirect('templates.php?a=manage&id='.db_input($id)); +} if($_POST){ switch(strtolower($_POST['do'])){