\global function makes problems

I've got a qusetion about \global... I've download a template for document settings in LaTex. There are a lot of \global... functions wich when I delete one of them I've this error: "Undefined control sequence. \titlepages" and some info about missing font shape. I don't need them all, so I would like to delete some. How to do it?

\documentclass[male, authorStatement, indexNumber, fileVersion, keywords, thanks]{lib/u}
\usepackage[utf8]{inputenc}

\globalFullAuthor{xxx}
\globalShortAuthor{x}
\globalFullTitle{Sym}
\globalShortTitle{Ryn}
\globalFullUniversity{Uniwer}
\globalShortUniversity{U}
\globalDepartment{Wyd}
\globalDegreeprogramme{Inf}
\globalThesisType{P}
\globalUnderTheSupervisonOf{Po}
\globalSupervisor{prof}
\globalAcknowledgements{Dla}
\globalFileVersion{0.9.0}
\globalIndexNumber{190}
\globalCity{K}
\globalYear{2015}
\globalKeywords{smth}


Also got second error: "\begin{itemize} on input line 235 ended by \end{document}. \end{document}"

From what i know it means that I'm missing "\end{itemize}" in page, which is not a true. It pops out with "\end{document}" line. I didn't find any explanation.

Here's also part of "lib/u.cls" which corresponds to \global:

%##############################################################################
% Variables definitions
%##############################################################################
\def\globalFullAuthor#1              {\gdef\@globalFullAuthor{#1}}
\def\globalShortAuthor#1             {\gdef\@globalShortAuthor{#1}}
\def\globalFullTitle#1               {\gdef\@globalFullTitle{#1}}
\def\globalShortTitle#1              {\gdef\@globalShortTitle{#1}}
\def\globalFullUniversity#1          {\gdef\@globalFullUniversity{#1}}
\def\globalShortUniversity#1         {\gdef\@globalShortUniversity{#1}}

\def\printFullAuthor{\@globalFullAuthor}              % Display
\def\printShortAuthor{\@globalShortAuthor}            % Display
\def\printFullTitle{\@globalFullTitle}                % Display
\def\printShortTitle{\@globalShortTitle}              % Display
\def\printFullUniversity{\@globalFullUniversity}      % Display
\def\printShortUniversity{\@globalShortUniversity}    % Display

• Can you point to to the source of lib/u.cls? – Joseph Wright Aug 27 '16 at 15:49
• I've edited first post. Sorry for my english, but maybe I didn't understand Your question. Maybe You want me to put full u.cls file? – Alek Aug 27 '16 at 16:09
• \def\globalFullAuthor#1 {\gdef\@globalFullAuthor{#1}} is so broken, the class code should really be fixed rather than trying to work around such things in the document. Where did this class come from? – David Carlisle Aug 27 '16 at 20:58
• it isn't possible to recreate the error using these fragments, you need to provide code that people can run that generates the error if you need help fixing the problem. – David Carlisle Aug 27 '16 at 21:00
• you have not shown the full error message but if it is undefined command \titlepages note that most classes define an environment \begin{titlepage}...\end{titlepage} not a \titlepages command. – David Carlisle Aug 27 '16 at 21:04

It is impossible to recreate the error using the fragments posted but the fragments have an obvious error which could cause weird spurious errors in the document if these \global... commands are used, so might possibly be the source of the problem.

\def\globalFullAuthor#1              {\gdef\@globalFullAuthor{#1}}
\def\globalShortAuthor#1             {\gdef\@globalShortAuthor{#1}}
\def\globalFullTitle#1               {\gdef\@globalFullTitle{#1}}
\def\globalShortTitle#1              {\gdef\@globalShortTitle{#1}}
\def\globalFullUniversity#1          {\gdef\@globalFullUniversity{#1}}
\def\globalShortUniversity#1         {\gdef\@globalShortUniversity{#1}}


should be

\def\globalFullAuthor#1{\gdef\@globalFullAuthor{#1}}
\def\globalShortAuthor#1{\gdef\@globalShortAuthor{#1}}
\def\globalFullTitle#1{\gdef\@globalFullTitle{#1}}
\def\globalShortTitle#1{\gdef\@globalShortTitle{#1}}
\def\globalFullUniversity#1{\gdef\@globalFullUniversity{#1}}
\def\globalShortUniversity#1{\gdef\@globalShortUniversity{#1}}


as it is the argument to (say) \globalFullAuthor is not the following {} group such as {xxx} in your example, it is everything up to the next space (or newline) character. In your example these happen to be the same thing as there is a newline after the } of {xxx} but if your real document misses those newlines the effect would be predictable but almost certainly unwanted.