Changeset 1431 for HelpIM3

Show
Ignore:
Timestamp:
03/01/11 05:52:27 (15 months ago)
Author:
winfried
Message:

- fixing startupmessages for the staff when client enters chat
- make questions appear in order of entering
- make answers appear in order of code
- pimping the closed page
- adding custom text to the RunCareSeekerPostChat? page

Location:
HelpIM3/branches/chatgroups
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • HelpIM3/branches/chatgroups/HelpIM/chat/pages/ShowOpenSchedule.py

    r757 r1431  
    1212        self.log = logging.getLogger('HelpIM.chat.pages.ShowShifts.Handler') 
    1313        self.panelId = 'ShowShifts' 
    14         self.panelName = 'Openingstijden' 
     14        self.panelName = 'Gesloten' 
    1515        self.showMenu = False 
     16        if kwargs['him_request'].site.siteConfig.dictOf__Text.has_key('ShowOpenScheduleText'): 
     17            self.panelMessage = kwargs['him_request'].site.siteConfig.dictOf__Text['ShowOpenScheduleText'].value 
     18 
    1619 
    1720    def showSession(self): 
     
    2427        self.log.debug('.getPanelData()') 
    2528         
    26         shiftDataElements = ['chat_shift_id', 'chat_shift_dayOfWeek', 'chat_shift_start_time', 'chat_shift_duration_time', 'endTime'] 
     29        shiftDataElements = ['chat_shift_id', 'chat_shift_dayOfWeek', 'chat_shift_start_time', 'endTime'] 
    2730        order_by = ['chat_shift_dayOfWeek', 'chat_shift_start_time'] 
    28         shiftsList = self.site.getTableData('Table_Data', 'Table_Record', self.site.getShiftList(self.site, order_by=['chat_shift_dayOfWeek', 'chat_shift_start_time']), shiftDataElements, fieldsAsAttributes)  
     31        shiftsList = self.site.getTableData('Table_Data', 'Table_Record', self.site.getShiftList(self.site, order_by=['chat_shift_dayOfWeek', 'chat_shift_start_time']), shiftDataElements, fieldsAsAttributes) 
     32        self.log.debug("*************  " + str(shiftsList['Table_Data'][1])) #[0]['Table_Record'])) 
     33        for i in range(len(shiftsList['Table_Data'][1])): 
     34            shiftsList['Table_Data'][1][i]['Table_Record'][0]["chat_shift_start_time"] = shiftsList['Table_Data'][1][i]['Table_Record'][0]["chat_shift_start_time"][:-3] + " uur" 
     35            shiftsList['Table_Data'][1][i]['Table_Record'][0]["endTime"] = shiftsList['Table_Data'][1][i]['Table_Record'][0]["endTime"][:-3] + " uur" 
    2936 
    3037        weekDayElements = {'weekDay_id':'id', 'weekDay_name':'desc'} 
     
    6673                                                 ]  
    6774                          }, 
    68                           {  'table_column': [  {    'heading':'Duur', 
    69                                                      'attrName': 'chat_shift_duration_time' 
    70                                                      } 
    71                                                  ]  
    72                           }, 
    7375                          {  'table_column': [  {    'heading':'Eind', 
    7476                                                     'attrName': 'endTime' 
  • HelpIM3/branches/chatgroups/HelpIM/chat/templates/Chat.py

    r1352 r1431  
    8181            if not self.configs.get("NICKNAME", False): 
    8282                self.configs["NICKNAME"] = "Helpline" 
     83            self.configs["ISSTAFF"] = "true" 
    8384        else: 
    8485            if not self.configs.get("TOPIC", False): 
     
    8687            if not self.configs.get("NICKNAME", False): 
    8788                self.configs["NICKNAME"] = "Child" 
     89            self.configs["ISSTAFF"] = "false" 
    8890 
    8991        # read config from config file 
     
    155157var STAFFCHAT = %(STAFFCHAT)s; 
    156158var MAXCHATS = %(MAXCHATS)s; 
    157 var ISSTAFF_RAW, ISSTAFF = "%(ISSTAFF)s"; 
     159var ISSTAFF = %(ISSTAFF)s; 
    158160var STARTUPLINES = %(STARTUPLINES)s; 
    159161var CHATGROUP_CHAT = %(CHATGROUP_CHAT)s; 
  • HelpIM3/branches/chatgroups/HelpIM/questionair/db/services.py

    r828 r1431  
    4545            questionair = qQuery.one() 
    4646            self.log.debug('Found questionair(%s)' % questionair.questionair_name) 
     47            # sort the fixed choice answers 
     48            for question in questionair.questions: 
     49                if question.question_type == "MK": 
     50                   question.answerDefinitions.sort(key=lambda k: k.fcAnswer_code) 
    4751            return questionair 
    4852        except NoResultFound: 
  • HelpIM3/branches/chatgroups/HelpIM/questionair/pages/RunCareSeekerPostChatQuestionair.py

    r929 r1431  
    2121        self.questionair = None 
    2222        self.questionairName = 'CS_POST_CHAT' 
     23        if kwargs['him_request'].site.siteConfig.dictOf__Text.has_key('RunCareSeekerPostChatQuestionairText'): 
     24            self.panelMessage = kwargs['him_request'].site.siteConfig.dictOf__Text['RunCareSeekerPostChatQuestionairText'].value 
    2325 
    2426    def performAction(self, *pargs, **kwargs): 
  • HelpIM3/branches/chatgroups/config/sites/full.xml

    r1430 r1431  
    1919        NumberOfChatsWaitingBeforeMe="0" 
    2020        isWaitingQueueFull="False" 
    21         cs_subject_id="2" 
     21        cs_subject_id="28" 
    2222        cs_nickname_id="1" 
    2323        chatQueueLength="120" 
     
    6363                </actionPerformed> 
    6464                <actionPerformed name="AddQuestion"> 
    65                         <actionResult name="actionResult_SUCCESS" target="ShowQuestions"> 
     65                        <actionResult name="actionResult_SUCCESS" target="ShowQuestionairs"> 
    6666                                <actionParm name="questionair_id" /> 
    6767                        </actionResult> 
    6868                </actionPerformed> 
    6969                <actionPerformed name="EditQuestion"> 
    70                         <actionResult name="actionResult_SUCCESS" target="ShowQuestions"> 
     70                        <actionResult name="actionResult_SUCCESS" target="ShowQuestionairs"> 
    7171                                <actionParm name="questionair_id" /> 
    7272                        </actionResult> 
    7373                </actionPerformed> 
    7474                <actionPerformed name="DeleteQuestion"> 
    75                         <actionResult name="actionResult_SUCCESS" target="ShowQuestions"> 
     75                        <actionResult name="actionResult_SUCCESS" target="ShowQuestionairs"> 
    7676                                <actionParm name="questionair_id" /> 
    7777                        </actionResult> 
     
    270270                        allowCookies="True" /> 
    271271                <page location="EditQuestionair" module="questionair" script="EditQuestionair" 
    272                         allowCookies="True" /> 
    273                 <page location="ShowQuestions" module="questionair" script="ShowQuestions" 
    274272                        allowCookies="True" /> 
    275273                <page location="AddQuestion" module="questionair" script="AddQuestion" 
     
    514512                <AuthorizedLocation key="AddQuestionair" /> 
    515513                <AuthorizedLocation key="EditQuestionair" /> 
    516                 <AuthorizedLocation key="ShowQuestions" /> 
    517514                <AuthorizedLocation key="AddQuestion" /> 
    518515                <AuthorizedLocation key="EditQuestion" /> 
     
    634631                <AuthorizedLocation key="AddQuestionair" /> 
    635632                <AuthorizedLocation key="EditQuestionair" /> 
    636                 <AuthorizedLocation key="ShowQuestions" /> 
    637633                <AuthorizedLocation key="AddQuestion" /> 
    638634                <AuthorizedLocation key="EditQuestion" /> 
     
    692688        <Text id="organisationName" value="Veilig Samen"/> 
    693689        <Text id="chatName" value="chat"/> 
    694  
     690  <Text id="RunCareSeekerPreChatQuestionairText" value="Om je snel van dienst te kunnen zijn vragen we je voor je gaat chatten een aantal vragen te beantwoorden. Daardoor kan de hulpverlener snel to-the-point komen en het helpt ons bij het verbeteren van het aanbod op deze site. We vragen niet naar persoonsgegevens en slaan geen IP-adressen op. Je blijft dus anoniem. Als je meer wilt lezen over je privacy en veiligheid als gebruiker van deze site, kijk dan op: https://www.veiligsamen.nl/privacy"/> 
     691  <Text id="RunCareSeekerPostChatQuestionairText" value="Wat vind je van deze site en het gesprek dat je net had? Dit is een nieuwe site en we willen iedereen zo goed mogelijk helpen. We hopen dat je onderstaande acht vragen wilt beantwoorden. Dat kan door het beste antwoord aan te klikken. Je blijft natuurlijk anoniem. Alvast bedankt!"/> 
     692  <Text id="ShowOpenScheduleText" value="De chat is momenteel gesloten. Onze openingstijden zijn:"/> 
    695693</siteConfig> 
  • HelpIM3/branches/chatgroups/htdocs/chat.js

    r1421 r1431  
    249249            user.roster.subject = msg.getSubject(); 
    250250            document.getElementById('header').innerHTML = TOPICHEADER+" "+htmlEnc(msg.getSubject()); 
    251             if (ISSTAFF == true) { 
     251            if (ISSTAFF) { 
    252252                putMsgHTML(TOPICMESSAGE+" "+msg.getSubject(), mtime, group); 
    253253            } 
     
    257257        /* look for startuplines */ 
    258258        if (msg.getType() == 'groupchat' && msg.getBody().substring(0,16) == "[#startuplines#]") { 
    259             if (ISSTAFF == true) { 
     259            if (ISSTAFF) { 
    260260                putMsgHTML(msg.getBody().substring(16), mtime, group); 
    261261            } 
  • HelpIM3/branches/chatgroups/htdocs/helpim.js

    r1377 r1431  
    3131 
    3232var aRoom = ROOMNAME+'@'+MUCDOMAIN; 
    33  
    34 var ISSTAFF = (ISSTAFF_RAW == "True"); 
    3533 
    3634var FULLPOSTURI; 
  • HelpIM3/branches/chatgroups/htdocs/xslt/HelpIM_html_UI_common.xslt

    r1419 r1431  
    301301                                                <xsl:apply-templates 
    302302                                                        select="//panel_data//*[name()=current()/@dataTable]//*[name()=current()/@dataRecord]"> 
    303                                                         <xsl:sort select="@question_id"/> 
     303                                                        <xsl:sort select="@question_creation_timestamp"/> 
    304304                                                        </xsl:apply-templates> 
    305305                        </xsl:element>