diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index ccbbfd2205a64ce64b526e6db37fddcf34677439..c47433fa371dcef4bdc14f644a03506d6895a9e0 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -155,8 +155,12 @@ class DynamicForm extends VerySimpleModel { $inst = DynamicFormEntry::create( array('form_id'=>$this->get('id'), 'sort'=>$sort) ); + if ($data) $inst->setSource($data); + + $inst->_fields = $this->_fields ?: null; + return $inst; } @@ -1786,7 +1790,7 @@ class SelectionField extends FormField { function getSearchMethods() { return array( 'set' => __('has a value'), - 'notset' => __('does not have a value'), + 'nset' => __('does not have a value'), 'includes' => __('includes'), '!includes' => __('does not include'), ); @@ -1795,7 +1799,7 @@ class SelectionField extends FormField { function getSearchMethodWidgets() { return array( 'set' => null, - 'notset' => null, + 'nset' => null, 'includes' => array('ChoiceField', array( 'choices' => $this->getChoices(), 'configuration' => array('multiselect' => true), diff --git a/include/class.pdf.php b/include/class.pdf.php index 39f47a80b4281561882db3b69d6a9ec6dd482052..d5ba67f1d2cd7bfce5137f892ab8e743650fcf8e 100644 --- a/include/class.pdf.php +++ b/include/class.pdf.php @@ -86,7 +86,7 @@ class Ticket2PDF extends mPDFWithLocalImages return; $html = ob_get_clean(); - $this->SetAutoFont(); + $this->SetAutoFont(AUTOFONT_RTL); $this->WriteHtml($html, 0, true, true); } } @@ -116,7 +116,7 @@ class Task2PDF extends mPDFWithLocalImages { ob_start(); include STAFFINC_DIR.'templates/task-print.tmpl.php'; $html = ob_get_clean(); - $this->SetAutoFont(); + $this->SetAutoFont(AUTOFONT_RTL); $this->WriteHtml($html, 0, true, true); } diff --git a/include/staff/users.inc.php b/include/staff/users.inc.php index 04c292a0bbf5fbc66b47f99564eb94f1fae8abdc..6e61c002b5ceb721bd50d8ed6d27d6111c1557d7 100644 --- a/include/staff/users.inc.php +++ b/include/staff/users.inc.php @@ -10,13 +10,15 @@ $users = User::objects() if ($_REQUEST['query']) { $search = $_REQUEST['query']; - $users->filter(Q::any(array( + $filter = Q::any(array( 'emails__address__contains' => $search, 'name__contains' => $search, 'org__name__contains' => $search, - 'cdata__phone__contains' => $search, - // TODO: Add search for cdata - ))); + )); + if (UserForm::getInstance()->getField('phone')) + $filter->add(array('cdata__phone__contains' => $search)); + + $users->filter($filter); $qs += array('query' => $_REQUEST['query']); }