本文整理汇总了PHP中Ubirimi\Util::cleanRegularInputField方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::cleanRegularInputField方法的具体用法?PHP Util::cleanRegularInputField怎么用?PHP Util::cleanRegularInputField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ubirimi\Util
的用法示例。
在下文中一共展示了Util::cleanRegularInputField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$queueId = $request->get('id');
$queue = $this->getRepository(Queue::class)->getById($queueId);
$projectId = $queue['project_id'];
$emptyName = false;
$queueExists = false;
if ($request->request->has('edit_queue')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
$description = Util::cleanRegularInputField($request->request->get('definition'));
if (empty($name)) {
$emptyName = true;
}
// check for duplication
$queue = $this->getRepository(Queue::class)->getByName($queueId, mb_strtolower($name), $projectId);
if ($queue) {
$queueExists = true;
}
if (!$queueExists && !$emptyName) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(Queue::class)->updateById($queueId, $name, $description, $description, $currentDate);
return new RedirectResponse('/helpdesk/queues/' . $projectId . '/' . $queueId);
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_HELP_DESK_NAME . ' / Update Queue';
return $this->render(__DIR__ . '/../../Resources/views/queue/Edit.php', get_defined_vars());
}
示例2: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$clientId = $session->get('client/id');
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = $request->request->get('description');
$location = $request->request->get('location');
$calendarId = $request->request->get('calendar');
$start = $request->request->get('start');
$end = $request->request->get('end');
$color = '#' . $request->request->get('color');
$repeatData = $request->request->get('repeat_data');
if (!empty($name)) {
$date = Util::getServerCurrentDateTime();
ini_set('memory_limit', '1024M');
$eventId = $this->getRepository(CalendarEvent::class)->add($calendarId, $session->get('user/id'), $name, $description, $location, $start, $end, $color, $date, $repeatData, $clientSettings);
// add the default reminders
$reminders = $this->getRepository(UbirimiCalendar::class)->getReminders($calendarId);
while ($reminders && ($reminder = $reminders->fetch_array(MYSQLI_ASSOC))) {
$this->getRepository(CalendarEvent::class)->addReminder($eventId, $reminder['cal_event_reminder_type_id'], $reminder['cal_event_reminder_period_id'], $reminder['value']);
}
$this->getLogger()->addInfo('ADD EVENTS event ' . $name, $this->getLoggerContext());
}
return new Response('');
}
示例3: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$screenId = $request->get('id');
$screenMetadata = $this->getRepository(Screen::class)->getMetaDataById($screenId);
if ($screenMetadata['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$position = $request->get('position');
$fieldId = $request->get('field_id');
if ($fieldId && $position) {
$this->getRepository(Screen::class)->updatePositionForField($screenId, $fieldId, $position);
return new RedirectResponse('/yongo/administration/screen/configure/' . $screenId);
}
$fields = $this->getRepository(Field::class)->getByClient($session->get('client/id'));
if ($request->request->has('add_screen_field')) {
$fieldId = Util::cleanRegularInputField($request->request->get('field'));
if ($fieldId != -1) {
$currentDate = Util::getServerCurrentDateTime();
$lastOrder = $this->getRepository(Screen::class)->getLastOrderNumber($screenId);
$this->getRepository(Screen::class)->addData($screenId, $fieldId, $lastOrder + 1, $currentDate);
$this->getLogger()->addInfo('UPDATE Yongo Screen Data ' . $screenMetadata['name'], $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/screen/configure/' . $screenId);
}
}
$screenData = $this->getRepository(Screen::class)->getDataById($screenId);
$menuSelectedCategory = 'issue';
$source = $request->get('source');
$projectId = null;
if ($source == 'project_screen' || $source == 'project_field') {
$projectId = $request->get('project_id');
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Screen';
return $this->render(__DIR__ . '/../../../Resources/views/administration/screen/Configure.php', get_defined_vars());
}
示例4: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$calendarId = $request->get('id');
$calendar = $this->getRepository(UbirimiCalendar::class)->getById($calendarId);
$defaultReminders = $this->getRepository(UbirimiCalendar::class)->getReminders($calendarId);
if ($calendar['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
if ($request->request->has('edit_calendar_settings')) {
$date = Util::getServerCurrentDateTime();
$this->getRepository(UbirimiCalendar::class)->deleteReminders($calendarId);
$this->getRepository(UbirimiCalendar::class)->deleteSharesByCalendarId($calendarId);
// reminder information
foreach ($request->request as $key => $value) {
if (strpos($key, 'reminder_type_') !== false) {
$indexReminder = str_replace('reminder_type_', '', $key);
$reminderType = Util::cleanRegularInputField($request->request->get($key));
$reminderValue = $request->request->get('value_reminder_' . $indexReminder);
$reminderPeriod = $request->request->get('reminder_period_' . $indexReminder);
// add the reminder
if (is_numeric($reminderValue)) {
$this->getRepository(UbirimiCalendar::class)->addReminder($calendarId, $reminderType, $reminderPeriod, $reminderValue);
}
}
}
$this->getLogger()->addInfo('UPDATE Calendar Default Reminders ' . $calendar['name'], $this->getLoggerContext());
return new RedirectResponse('/calendar/calendars');
}
$menuSelectedCategory = 'calendar';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_CALENDAR_NAME . ' / Calendar: ' . $calendar['name'] . ' / Settings';
return $this->render(__DIR__ . '/../Resources/views/Settings.php', get_defined_vars());
}
示例5: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyPriorityName = false;
$priorityExists = false;
if ($request->request->has('new_priority')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
$color = Util::cleanRegularInputField($request->request->get('color'));
if (empty($name)) {
$emptyPriorityName = true;
}
// check for duplication
$priority = $this->getRepository(IssueSettings::class)->getByName($session->get('client/id'), 'priority', mb_strtolower($name));
if ($priority) {
$priorityExists = true;
}
if (!$priorityExists && !$emptyPriorityName) {
$iconName = 'generic.png';
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(IssueSettings::class)->create('issue_priority', $session->get('client/id'), $name, $description, $iconName, $color, $currentDate);
$this->getLogger()->addInfo('ADD Yongo Issue Priority ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/issue/priorities');
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Issue Priority';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/issue/priority/Add.php', get_defined_vars());
}
示例6: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$allIssueTypes = $this->getRepository(IssueType::class)->getAll($session->get('client/id'));
if ($request->request->has('new_issue_type_screen_scheme')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
if (!$emptyName) {
$issueTypeScreenScheme = new IssueTypeScreenScheme($session->get('client/id'), $name, $description);
$currentDate = Util::getServerCurrentDateTime();
$issueTypeScreenSchemeId = $issueTypeScreenScheme->save($currentDate);
$issueTypes = $this->getRepository(IssueType::class)->getAll($session->get('client/id'));
while ($issueType = $issueTypes->fetch_array(MYSQLI_ASSOC)) {
$this->getRepository(IssueTypeScreenScheme::class)->addData($issueTypeScreenSchemeId, $issueType['id'], $currentDate);
}
$this->getLogger()->addInfo('ADD Yongo Issue Type Screen Scheme ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/screens/issue-types');
}
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Issue Type Screen Scheme';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/screen/issue_type_scheme/Add.php', get_defined_vars());
}
示例7: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$menuSelectedCategory = 'issue';
$emptyName = false;
$fields = $this->getRepository(Field::class)->getByClient($session->get('client/id'));
if ($request->request->has('add_screen')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
$currentDate = Util::getServerCurrentDateTime();
if (empty($name)) {
$emptyName = true;
}
if (!$emptyName) {
$screen = new Screen($session->get('client/id'), $name, $description);
$screenId = $screen->save($currentDate);
$order = 0;
foreach ($request->request as $key => $value) {
if (substr($key, 0, 6) == 'field_') {
$order++;
$fieldId = str_replace('field_', '', $key);
$this->getRepository(Screen::class)->addData($screenId, $fieldId, $order, $currentDate);
}
}
$this->getLogger()->addInfo('ADD Yongo Screen ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/screens');
}
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Screen';
return $this->render(__DIR__ . '/../../../Resources/views/administration/screen/Add.php', get_defined_vars());
}
示例8: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$duplicateOrganization = false;
$organizationId = $request->get('id');
$organization = $this->getRepository(Organization::class)->getById($organizationId);
if ($request->request->has('edit_organization')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
$organizationDuplicate = $this->getRepository(Organization::class)->getByName($session->get('client/id'), mb_strtolower($name), $organizationId);
if ($organizationDuplicate) {
$duplicateOrganization = true;
}
if (!$emptyName && !$organizationDuplicate) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(Organization::class)->updateById($organizationId, $name, $description, $currentDate);
$this->getLogger()->addInfo('UPDATE Organization ' . $name, $this->getLoggerContext());
return new RedirectResponse('/helpdesk/administration/organizations');
}
}
$menuSelectedCategory = 'helpdesk_organizations';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_HELP_DESK_NAME . ' / Create Organization';
return $this->render(__DIR__ . '/../../../Resources/views/administration/organization/EditOrganization.php', get_defined_vars());
}
示例9: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$menuSelectedCategory = 'svn';
$userId = $request->query->get('id', $request->request->get('id'));
$repoId = $request->query->get('repo_id', $request->request->get('repo_id'));
$user = $this->getRepository(UbirimiUser::class)->getById($userId);
$svnRepo = $this->getRepository(SvnRepository::class)->getById($repoId);
$errors = array('empty_password' => false, 'password_mismatch' => false);
if ($request->request->has('password') || $request->request->has('password_again')) {
$password = Util::cleanRegularInputField($request->request->get('password'));
$passwordAgain = Util::cleanRegularInputField($request->request->get('password_again'));
if (empty($password)) {
$errors['empty_password'] = true;
}
if ($password != $passwordAgain) {
$errors['password_mismatch'] = true;
}
if (Util::hasNoErrors($errors)) {
$this->getRepository(SvnRepository::class)->updateUserPassword($session->get('selected_svn_repo_id'), $userId, $password);
$this->getRepository(SvnRepository::class)->updateHtpasswd($session->get('selected_svn_repo_id'), $session->get('client/company_domain'));
$this->getRepository(SvnRepository::class)->updateAuthz();
$svnEvent = new SvnHostingEvent($svnRepo['name'], $user, array('password' => $password));
$this->getLogger()->addInfo(sprintf('SVN Change Password for [%s]', $svnRepo['name']), $this->getLoggerContext());
UbirimiContainer::get()['dispatcher']->dispatch(SvnHostingEvents::PASSWORD_UPDATE, $svnEvent);
return new Response('1');
}
}
$menuSelectedCategory = 'svn';
return $this->render(__DIR__ . '/../Resources/views/ChangePassword.php', get_defined_vars());
}
示例10: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyValue = false;
$duplicateValue = false;
$customFieldId = $request->get('id');
$field = $this->getRepository(Field::class)->getById($customFieldId);
if ($request->request->has('new_custom_value')) {
$value = Util::cleanRegularInputField($request->request->get('value'));
if (empty($value)) {
$emptyValue = true;
}
if (!$emptyValue) {
$customValueExists = $this->getRepository(Field::class)->getDataByFieldIdAndValue($customFieldId, $value);
if ($customValueExists) {
$duplicateValue = true;
}
}
if (!$emptyValue && !$duplicateValue) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(Field::class)->addData($customFieldId, $value, $currentDate);
$this->getLogger()->addInfo('ADD Field Custom Value ' . $value, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/custom-fields/define/' . $customFieldId);
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Add Custom Field Value';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/field/custom/AddValue.php', get_defined_vars());
}
示例11: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$menuSelectedCategory = 'calendars';
$emptyName = false;
$duplicateName = false;
if ($request->request->has('confirm_new_calendar')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
$color = Util::cleanRegularInputField($request->request->get('color'));
if (empty($name)) {
$emptyName = true;
}
$calendarSameName = $this->getRepository(UbirimiCalendar::class)->getByName($session->get('user/id'), $name);
if ($calendarSameName) {
$duplicateName = true;
}
if (!$emptyName && !$duplicateName) {
$currentDate = Util::getServerCurrentDateTime();
$calendarId = $this->getRepository(UbirimiCalendar::class)->save($session->get('user/id'), $name, $description, $color, $currentDate);
// add default reminders
$this->getRepository(UbirimiCalendar::class)->addReminder($calendarId, ReminderType::REMINDER_EMAIL, ReminderPeriod::PERIOD_MINUTE, 30);
$this->getLogger()->addInfo('ADD EVENTS calendar ' . $name, $this->getLoggerContext());
return new RedirectResponse('/calendar/calendars');
}
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_CALENDAR_NAME . ' / Create Calendar';
return $this->render(__DIR__ . '/../Resources/views/Add.php', get_defined_vars());
}
示例12: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$workflowId = $request->get('id');
$workflow = $this->getRepository(Workflow::class)->getMetaDataById($workflowId);
if ($workflow['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$emptyName = false;
$duplicateName = false;
if ($request->request->has('copy_workflow')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
$workflowAlreadyExisting = $this->getRepository(Workflow::class)->getByClientIdAndName($session->get('client/id'), $name);
if ($workflowAlreadyExisting) {
$duplicateName = true;
}
if (!$emptyName && !$workflowAlreadyExisting) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(Workflow::class)->copy($session->get('client/id'), $workflowId, $name, $description, $currentDate);
$this->getLogger()->addInfo('Copy Yongo Workflow ' . $workflow['name'], $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/workflows');
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Copy Workflow';
return $this->render(__DIR__ . '/../../../Resources/views/administration/workflow/Copy.php', get_defined_vars());
}
示例13: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$Id = $request->get('id');
$group = $this->getRepository(UbirimiGroup::class)->getMetadataById($Id);
if ($group['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$name = $group['name'];
$description = $group['description'];
$emptyName = false;
$duplicateName = false;
if ($request->request->has('update_group')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
if (!$emptyName) {
$groupAlreadyExists = $this->getRepository(UbirimiGroup::class)->getByNameAndProductId($session->get('client/id'), SystemProduct::SYS_PRODUCT_YONGO, mb_strtolower($name), $Id);
if ($groupAlreadyExists) {
$duplicateName = true;
}
}
if (!$emptyName && !$duplicateName) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(UbirimiGroup::class)->updateById($Id, $name, $description, $currentDate);
$this->getLogger()->addInfo('UPDATE Yongo Group ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/groups');
}
}
$menuSelectedCategory = 'user';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Group';
return $this->render(__DIR__ . '/../../../Resources/views/administration/group/Edit.php', get_defined_vars());
}
示例14: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$duplicateName = false;
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
$notebookSameName = $this->getRepository(Notebook::class)->getByName($session->get('user/id'), $name);
if ($notebookSameName) {
$duplicateName = true;
}
if (!$emptyName && !$duplicateName) {
$currentDate = Util::getServerCurrentDateTime();
$defaultFlag = 0;
// get the default notebook
$defaultNotebook = $this->getRepository(Notebook::class)->getDefaultByUserId($session->get('user/id'));
if (!$defaultNotebook) {
$defaultFlag = 1;
}
$notebookId = $this->getRepository(Notebook::class)->save($session->get('user/id'), $name, $description, $defaultFlag, $currentDate);
$this->getLogger()->addInfo('ADD QUICK NOTES notebook ' . $name, $this->getLoggerContext());
}
return new Response('');
}
示例15: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$clientId = $session->get('client/id');
$session->set('selected_product_id', -1);
$menuSelectedCategory = 'general_overview';
$timezoneData = explode("/", $session->get('client/settings/timezone'));
$timezoneContinent = $timezoneData[0];
$timeZoneContinents = array('Africa' => 1, 'America' => 2, 'Antarctica' => 4, 'Arctic' => 8, 'Asia' => 16, 'Atlantic' => 32, 'Australia' => 64, 'Europe' => 128, 'Indian' => 256, 'Pacific' => 512);
$timeZoneCountry = $timezoneData[1];
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
$client = $this->getRepository(UbirimiClient::class)->getById($clientId);
if ($request->request->has('update_configuration')) {
$language = Util::cleanRegularInputField($request->request->get('language'));
$timezone = Util::cleanRegularInputField($request->request->get('zone'));
$titleName = Util::cleanRegularInputField($request->request->get('title_name'));
$operatingMode = Util::cleanRegularInputField($request->request->get('mode'));
$parameters = array(array('field' => 'title_name', 'value' => $titleName, 'type' => 's'), array('field' => 'operating_mode', 'value' => $operatingMode, 'type' => 's'), array('field' => 'language', 'value' => $language, 'type' => 's'), array('field' => 'timezone', 'value' => $timezone, 'type' => 's'));
$this->getRepository(UbirimiClient::class)->updateProductSettings($clientId, 'client_settings', $parameters);
$session->set('client/settings/language', $language);
$session->set('client/settings/timezone', $timezone);
return new RedirectResponse('/general-settings/view-general');
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / GeneralSettings Settings / Update';
return $this->render(__DIR__ . '/../Resources/views/EditSettings.php', get_defined_vars());
}