X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fufbuilder.inc.php;h=b3233e1c7c7880cc8abbe4e5cb53d783410f8e93;hb=956cd5c10a027f75283d91545a5d5feeed1874ef;hp=2c392379b37087c84bb9f1364661a337088fd8d3;hpb=6ae6840d23628e9dbba7b62c58df98b843e34728;p=platal.git diff --git a/include/ufbuilder.inc.php b/include/ufbuilder.inc.php index 2c39237..b3233e1 100644 --- a/include/ufbuilder.inc.php +++ b/include/ufbuilder.inc.php @@ -1114,6 +1114,32 @@ class UFBF_SubAdminArea extends UFBF_Index } // }}} +// {{{ class UFBF_SubAdminArea +class UFBF_SubAdminArea extends UFBF_Index +{ + protected $direnum = DirEnum::SUBADMINAREAS; + protected $onlycurrentfield; + + public function __construct($envfield, $formtext = '', $onlycurrentfield = 'only_current') + { + parent::__construct($envfield, $formtext); + $this->onlycurrentfield = $onlycurrentfield; + } + + + protected function buildUFC(UserFilterBuilder &$ufb) + { + if ($ufb->isOn($this->onlycurrentfield)) { + $flags = UFC_Address::FLAG_CURRENT; + } else { + $flags = UFC_Address::FLAG_ANY; + } + + return new UFC_AddressField($this->val, UFC_AddressField::FIELD_SUBADMAREA, UFC_Address::TYPE_ANY, $flags); + } +} +// }}} + // {{{ class UFBF_JobCompany class UFBF_JobCompany extends UFBF_Text {