diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index c867531d983434cc99f9d7883f485405ce916587..a63a8cc67c68702cb7c0e7f990b6ee5afda40055 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1176,8 +1176,9 @@ class DynamicFormEntry extends VerySimpleModel { ->filter(array('object_id'=>$object_id, 'object_type'=>$object_type)); } - function render($staff=true, $title=false, $options=array()) { - return $this->getForm()->render($staff, $title, $options); + function render($options=array()) { + $options += array('staff' => true); + return $this->getForm()->render($options); } function getChanges() { diff --git a/include/class.forms.php b/include/class.forms.php index 6f28d71f98dbf476523733f75c87bcaf3b5251fd..e97ea6358311106fe56ad185e2419acb4e7c0039 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -165,14 +165,14 @@ class Form { $this->validators[] = $function; } - function render($staff=true, $title=false, $options=array()) { - if ($title) - $this->title = $title; + function render($options=array()) { + if (isset($options['title'])) + $this->title = $options['title']; if (isset($options['instructions'])) $this->instructions = $options['instructions']; $form = $this; $template = $options['template'] ?: 'dynamic-form.tmpl.php'; - if ($staff) + if (isset($options['staff']) && $options['staff']) include(STAFFINC_DIR . 'templates/' . $template); else include(CLIENTINC_DIR . 'templates/' . $template); @@ -4364,7 +4364,7 @@ class FileUploadWidget extends Widget { ), ); - function render($options) { + function render($options=array()) { $config = $this->field->getConfiguration(); $name = $this->field->getFormName(); $id = substr(md5(spl_object_hash($this)), 10); @@ -4849,7 +4849,7 @@ class AssignmentForm extends Form { return !$this->errors(); } - function render($options) { + function render($options=array()) { switch(strtolower($options['template'])) { case 'simple': @@ -5093,7 +5093,7 @@ class ReferralForm extends Form { return !$this->errors(); } - function render($options) { + function render($options=array()) { switch(strtolower($options['template'])) { case 'simple': @@ -5201,7 +5201,7 @@ class TransferForm extends Form { return !$this->errors(); } - function render($options) { + function render($options=array()) { switch(strtolower($options['template'])) { case 'simple': diff --git a/include/class.search.php b/include/class.search.php index 6ad68f283dd04b2b835fde67935c464821ca8a89..7d9fb691a37dc9edd0087566356b4a85655570b2 100644 --- a/include/class.search.php +++ b/include/class.search.php @@ -912,7 +912,7 @@ extends SavedSearch { return false; } - function checkAccess($staff) { + function checkAccess(Staff $staff) { return true; } @@ -1278,7 +1278,7 @@ class TeamSelectionField extends AdvancedSearchSelectionField { return parent::getSearchQ($method, $value, $name); } - function getSortKeys() { + function getSortKeys($path) { return array('team__name'); } diff --git a/include/client/edit.inc.php b/include/client/edit.inc.php index 6f364db394f3acaff7c52557764108802578b63e..27ae212eeaceeaf999174c23f43bdd58c6d58ea6 100644 --- a/include/client/edit.inc.php +++ b/include/client/edit.inc.php @@ -16,7 +16,7 @@ if(!defined('OSTCLIENTINC') || !$thisclient || !$ticket || !$ticket->checkUserAc <tbody id="dynamic-form"> <?php if ($forms) foreach ($forms as $form) { - $form->render(false); + $form->render(['staff' => false]); } ?> </tbody> </table> diff --git a/include/client/open.inc.php b/include/client/open.inc.php index 4011d14038391c6fad5e4d291a9f1818de36f736..111c34bb9945cf8a82880c2b515b496ee84363d8 100644 --- a/include/client/open.inc.php +++ b/include/client/open.inc.php @@ -42,7 +42,7 @@ if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) { if (!$thisclient) { $uform = UserForm::getUserForm()->getForm($_POST); if ($_POST) $uform->isValid(); - $uform->render(false); + $uform->render(array('staff' => false)); } else { ?> <tr><td colspan="2"><hr /></td></tr> diff --git a/include/client/profile.inc.php b/include/client/profile.inc.php index 5a72f571033c02035b16c1505a4ca1f4d90dd749..c86becf95d4a369f87b9b51ee88942a237bd0ca2 100644 --- a/include/client/profile.inc.php +++ b/include/client/profile.inc.php @@ -8,7 +8,7 @@ <table width="800" class="padded"> <?php foreach ($user->getForms() as $f) { - $f->render(false); + $f->render(['staff' => false]); } if ($acct = $thisclient->getAccount()) { $info=$acct->getInfo(); diff --git a/include/client/register.inc.php b/include/client/register.inc.php index 4f683c718d8fc27cb7404ae21f722a289f51967a..a08e35fc910061156b7b9e4ee44012cf2133f3c0 100644 --- a/include/client/register.inc.php +++ b/include/client/register.inc.php @@ -27,7 +27,7 @@ $info = Format::htmlchars(($errors && $_POST)?$_POST:$info); <tbody> <?php $cf = $user_form ?: UserForm::getInstance(); - $cf->render(false, false, array('mode' => 'create')); + $cf->render(array('staff' => false, 'mode' => 'create')); ?> <tr> <td colspan="2"> diff --git a/include/staff/templates/org-lookup.tmpl.php b/include/staff/templates/org-lookup.tmpl.php index 07d6c7687f8d559d44c4fb0eb761b04c8d4ed58f..21a3f55fc018f968df6f9c9b88be5574d90d5e00 100644 --- a/include/staff/templates/org-lookup.tmpl.php +++ b/include/staff/templates/org-lookup.tmpl.php @@ -70,7 +70,7 @@ if ($info['error']) { <table width="100%" class="fixed"> <?php if (!$form) $form = OrganizationForm::getInstance(); - $form->render(true, __('Create New Organization')); ?> + $form->render(array('staff' => true, 'title' => __('Create New Organization'))); ?> </table> <hr> <p class="full-width"> diff --git a/include/staff/templates/user-lookup.tmpl.php b/include/staff/templates/user-lookup.tmpl.php index cfeeaddf65b5ce7640cef5158eac44a642e5c202..62547c99bc7e1d8e59f6222d3859116b89437a97 100644 --- a/include/staff/templates/user-lookup.tmpl.php +++ b/include/staff/templates/user-lookup.tmpl.php @@ -84,7 +84,7 @@ if ($user) { ?> <table width="100%" class="fixed"> <?php if(!$form) $form = UserForm::getInstance(); - $form->render(true, __('Create New User')); ?> + $form->render(['staff' => true, 'title' => __('Create New User')]); ?> </table> <hr> <p class="full-width"> diff --git a/include/staff/ticket-edit.inc.php b/include/staff/ticket-edit.inc.php index 71d8871e65af1f9ff1b73959b0c0bb043a464c0b..0fc656a8aa633031556829ca7aa3d27d0c639d05 100644 --- a/include/staff/ticket-edit.inc.php +++ b/include/staff/ticket-edit.inc.php @@ -154,7 +154,7 @@ if ($_POST) <table class="form_table dynamic-forms" width="940" border="0" cellspacing="0" cellpadding="2"> <?php if ($forms) foreach ($forms as $form) { - $form->render(true, false, array('mode'=>'edit','width'=>160,'entry'=>$form)); + $form->render(array('staff'=>true,'mode'=>'edit','width'=>160,'entry'=>$form)); } ?> </table> <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">