def __getOperationTitle(self):
     currentOperation = self.getOperation()
     chainState = self.__getChainState(self.getChain())
     state = PERSONAL_MISSIONS_ALIASES.OPERATION_UNLOCKED_STATE
     tooltip = {
         'tooltip': None,
         'isSpecial': False,
         'specialAlias': None,
         'specialArgs': None
     }
     if not currentOperation.isUnlocked():
         label = text_styles.stats(
             PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_LOCKED)
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_LOCKED_STATE
     elif chainState.isFullCompleted:
         label = text_styles.bonusAppliedText(
             PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_EXCELLENTDONE)
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_COMPLETE_FULL_STATE
     elif chainState.isCompleted:
         infoIcon = icons.makeImageTag(
             RES_ICONS.MAPS_ICONS_LIBRARY_NOTIF_FILTERS_INFORMATION_16X16,
             16, 16, -2)
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_COMPLETE_STATE
         currentCount = currentOperation.getFreeTokensCount()
         totalCount = currentOperation.getFreeTokensTotalCount()
         if currentCount < totalCount:
             icon = icons.makeImageTag(
                 AwardSheetPresenter.getIcon(AwardSheetPresenter.Size.MID),
                 24, 24, -22)
             count = str(currentCount)
             total = str(totalCount)
             label = text_styles.stats(
                 _ms(PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_DONE,
                     icon=icon,
                     count=count,
                     total=total,
                     infoIcon=infoIcon))
             tooltip.update({
                 'isSpecial':
                 True,
                 'specialAlias':
                 TOOLTIPS_CONSTANTS.FREE_SHEET,
                 'specialArgs': [currentOperation.getCampaignID()]
             })
         else:
             count = str(len(currentOperation.getFullCompletedQuests()))
             total = str(currentOperation.getQuestsCount())
             label = text_styles.stats(
                 _ms(PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_TOMASTER,
                     count=count,
                     total=total,
                     infoIcon=infoIcon))
             tooltip[
                 'tooltip'] = TOOLTIPS.PERSONALMISSIONS_OPERATIONTITLE_COMPLETESTATE
     elif chainState.questInProgress:
         if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
             vehData = '  '
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_INPROGRESS_PM2
         else:
             vehData = ''
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_INPROGRESS_REGULAR
         vehData += getChainVehRequirements(currentOperation,
                                            self.getChainID(),
                                            useIcons=True)
         label = text_styles.stats(_ms(template, vehData=vehData))
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_CURRENT_STATE
     elif not chainState.hasVehicle:
         if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
             vehData = '  '
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_PM2
         else:
             vehData = ''
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_REGULAR
         vehData += getChainVehRequirements(currentOperation,
                                            self.getChainID(),
                                            useIcons=True)
         label = text_styles.stats(_ms(template, vehData=vehData))
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_NO_VEHICLE_STATE
     else:
         if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
             vehData = '  '
             template = text_styles.stats(
                 PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_UNLOCKED_PM2)
         else:
             vehData = ''
             template = text_styles.stats(
                 PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_UNLOCKED_REGULAR)
         vehData += getChainVehRequirements(currentOperation,
                                            self.getChainID(),
                                            useIcons=True)
         label = text_styles.stats(_ms(template, vehData=vehData))
     return {
         'title':
         text_styles.promoTitle(
             _ms(PERSONAL_MISSIONS.OPERATIONTITLE_TITLE,
                 title=_ms('#personal_missions:operations/title%d' %
                           currentOperation.getID()))),
         'label':
         label,
         'state':
         state,
         'tooltip':
         tooltip
     }
    def __updateFooter(self):
        chainState = self.__getChainState(self.getChain())
        isQuestInProgress = False
        btnVisible = False
        btnEnabled = False
        btnLabel = ''
        descr = ''
        currentOperation = self.getOperation()
        chainClassifier = currentOperation.getChainClassifier(
            self.getChainID())
        vehicleClass = getTypeShortUserName(chainClassifier.classificationAttr)
        pm = self._eventsCache.getPersonalMissions()
        branch = self.getBranch()
        freeSheets = pm.getFreeTokensCount(branch)
        pawnedSheets = pm.getPawnedTokensCount(branch)
        if not chainState.hasUnlocked:
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(PERSONAL_MISSIONS.STATUSPANEL_STATUS_LOCKED))
        elif chainState.questInProgress is not None:
            quest = chainState.questInProgress
            if quest.isOnPause:
                status = text_styles.concatStylesWithSpace(
                    icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ONPAUSE,
                                       16, 16, -3, 8),
                    text_styles.playerOnline(quest.getUserName()))
            else:
                isQuestInProgress = True
                status = text_styles.concatStylesWithSpace(
                    icons.inProgress(),
                    text_styles.tutorial(quest.getUserName()))
            if quest.areTokensPawned():
                descr = text_styles.neutral(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_PAWNED,
                        count=quest.getPawnCost(),
                        icon=getHtmlAwardSheetIcon(quest.getQuestBranch())))
            elif quest.isMainCompleted():
                descr = text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_IMPROVE)
            elif quest.canBePawned() and not quest.isDisabled():
                btnVisible = True
                pawnCost = quest.getPawnCost()
                btnLabel = _ms(
                    PERSONAL_MISSIONS.STATUSPANEL_FREESHEETBTN_LABEL,
                    count=pawnCost,
                    icon=getHtmlAwardSheetIcon(quest.getQuestBranch()))
                if pawnCost <= freeSheets:
                    btnEnabled = True
        elif chainState.isFullCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.doubleCheckmark(1),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLEXCELLENTDONE,
                        vehicleClass=vehicleClass)))
        elif chainState.isCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.checkmark(-2),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLDONE,
                        vehicleClass=vehicleClass)))
        elif not chainState.hasVehicle:
            if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
                template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_PM2
            else:
                template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_REGULAR
            vehData = getChainVehRequirements(currentOperation,
                                              self.getChainID(),
                                              useIcons=False)
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(_ms(template, vehData=vehData)))
        else:
            status = text_styles.concatStylesWithSpace(
                icons.makeImageTag(
                    RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16,
                    -2),
                text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_SELECTTASK))
        tankwomanQuests = []
        for operation in pm.getAllOperations().itervalues():
            tankwomanQuests.extend(
                operation.getQuestsByFilter(
                    PersonalMission.needToGetTankWoman).itervalues())

        counterText = ''
        tankwomanVisible = False
        if tankwomanQuests:
            counterText = text_styles.highlightText('x%s' %
                                                    len(tankwomanQuests))
            tankwomanVisible = True
        self.as_setStatusDataS({
            'statusText': status,
            'descrText': descr,
            'btnVisible': btnVisible,
            'btnEnabled': btnEnabled,
            'btnLabel': btnLabel,
            'sheetsBlockData': {
                'freeSheetsIcon':
                AwardSheetPresenter.getIcon(AwardSheetPresenter.Size.MID),
                'freeSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_FREESHEETS,
                        count=text_styles.highlightText(freeSheets))),
                'pawnedSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_PAWNEDSHEETS,
                        count=text_styles.highlightText(pawnedSheets))),
                'tooltipData': {
                    'isSpecial':
                    True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.FREE_SHEET_RETURN if freeSheets
                    or pawnedSheets else TOOLTIPS_CONSTANTS.FREE_SHEET,
                    'specialArgs': [currentOperation.getCampaignID()]
                },
                'popover':
                PERSONAL_MISSIONS_ALIASES.FREE_SHEET_POPOVER,
                'popoverData': {
                    'branch': branch
                }
            },
            'tankgirlsBlockData': {
                'counterText': counterText,
                'visible': tankwomanVisible,
                'tooltipData': {
                    'isSpecial': True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.PERSONAL_MISSIONS_TANKWOMAN,
                    'specialArgs': []
                },
                'popover': PERSONAL_MISSIONS_ALIASES.TANK_GIRLS_POPOVER
            },
            'tooltip': None,
            'isQuestInProgress': isQuestInProgress
        })
        return