Skip to content
Snippets Groups Projects
Commit 7c5489c4 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge remote branch 'upstream/develop' into develop-next

Conflicts:
	js/osticket.js
parents 953bfeb3 7a107737
No related branches found
No related tags found
No related merge requests found
...@@ -184,9 +184,7 @@ class FAQ { ...@@ -184,9 +184,7 @@ class FAQ {
// Inline images (attached to the draft) // Inline images (attached to the draft)
$this->attachments->deleteInlines(); $this->attachments->deleteInlines();
if (isset($vars['draft_id']) && $vars['draft_id']) $this->attachments->upload(Draft::getAttachmentIds($vars['answer']));
if ($draft = Draft::lookup($vars['draft_id']))
$this->attachments->upload($draft->getAttachmentIds(), true);
$this->reload(); $this->reload();
......
...@@ -714,6 +714,13 @@ class PersonsName { ...@@ -714,6 +714,13 @@ class PersonsName {
$r = explode(' ', $name); $r = explode(' ', $name);
$size = count($r); $size = count($r);
//check if name is bad format (ex: J.Everybody), and fix them
if($size==1 && mb_strpos($r[0], '.') !== false)
{
$r = explode('.', $name);
$size = count($r);
}
//check first for period, assume salutation if so //check first for period, assume salutation if so
if (mb_strpos($r[0], '.') === false) if (mb_strpos($r[0], '.') === false)
......
...@@ -220,3 +220,16 @@ function __(s) { ...@@ -220,3 +220,16 @@ function __(s) {
} }
$.clientPortal = true; $.clientPortal = true;
$(document).on('submit', 'form', function() {
// Reformat dates
$('.dp', $(this)).each(function(i, e) {
var $e = $(e),
d = $e.datepicker('getDate');
if (!d) return;
var day = ('0'+d.getDate()).substr(-2),
month = ('0'+(d.getMonth()+1)).substr(-2),
year = d.getFullYear();
$e.val(year+'-'+month+'-'+day);
});
});
...@@ -27,11 +27,9 @@ if($_POST) { ...@@ -27,11 +27,9 @@ if($_POST) {
$_REQUEST['a'] = null; $_REQUEST['a'] = null;
$msg=sprintf(__('Successfully added %s'), Format::htmlchars($_POST['name'])); $msg=sprintf(__('Successfully added %s'), Format::htmlchars($_POST['name']));
// Attach inline attachments from the editor // Attach inline attachments from the editor
if (isset($_POST['draft_id']) if ($page = Page::lookup($pageId))
&& ($draft = Draft::lookup($_POST['draft_id']))
&& ($page = Page::lookup($pageId)))
$page->attachments->upload( $page->attachments->upload(
$draft->getAttachmentIds($_POST['response']), true); Draft::getAttachmentIds($_POST['body']), true);
Draft::deleteForNamespace('page'); Draft::deleteForNamespace('page');
} elseif(!$errors['err']) } elseif(!$errors['err'])
$errors['err'] = sprintf(__('Unable to add %s. Correct error(s) below and try again.'), $errors['err'] = sprintf(__('Unable to add %s. Correct error(s) below and try again.'),
...@@ -46,12 +44,10 @@ if($_POST) { ...@@ -46,12 +44,10 @@ if($_POST) {
__('this site page')); __('this site page'));
$_REQUEST['a']=null; //Go back to view $_REQUEST['a']=null; //Go back to view
// Attach inline attachments from the editor // Attach inline attachments from the editor
if (isset($_POST['draft_id']) $page->attachments->deleteInlines();
&& ($draft = Draft::lookup($_POST['draft_id']))) { $page->attachments->upload(
$page->attachments->deleteInlines(); Draft::getAttachmentIds($_POST['body']),
$page->attachments->upload( true);
$draft->getAttachmentIds($_POST['response']),
true);
} }
Draft::deleteForNamespace('page.'.$page->getId()); Draft::deleteForNamespace('page.'.$page->getId());
} elseif(!$errors['err']) } elseif(!$errors['err'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment