dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37033
Re: [Branch ~dhis2-devs-core/dhis2/trunk] Rev 18943: Set program indicator description and expression to text
Hi Calle,
yes we can do that. I don't think we just want to change the current text
type as having a limited text field is useful (e.g. for additional names).
So I have now implemented a new attribute value type called "text" which
renders as a textarea and has no length limit. Backported to 2.18.
Lars
On Sun, Apr 19, 2015 at 2:55 PM, Calle Hedberg <calle.hedberg@xxxxxxxxx>
wrote:
> Lars,
>
> Since you are busy modifying some tables already, would you please also
> add a modification for the "attributevalue" table:
>
> + executeSql( "ALTER TABLE attributevalue ALTER value TYPE text" );
>
> Then remove any UI code that limits the value length.
>
> We are having hundreds of attribute values being truncated due to the 255
> character limit (and the UI limit is even less).
>
> Regards
> Calle
>
> On 19 April 2015 at 13:40, <noreply@xxxxxxxxxxxxx> wrote:
>
>> ------------------------------------------------------------
>> revno: 18943
>> committer: Lars Helge Overland <larshelge@xxxxxxxxx>
>> branch nick: dhis2
>> timestamp: Sun 2015-04-19 13:38:17 +0200
>> message:
>> Set program indicator description and expression to text
>> modified:
>>
>> dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
>>
>> dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml
>>
>> dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
>>
>> dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
>>
>> dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm
>>
>> dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm
>>
>>
>> --
>> lp:dhis2
>> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
>>
>> Your team DHIS 2 developers is subscribed to branch lp:dhis2.
>> To unsubscribe from this branch go to
>> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
>>
>> === modified file
>> 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
>> ---
>> dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
>> 2015-04-17 07:58:50 +0000
>> +++
>> dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
>> 2015-04-19 11:38:17 +0000
>> @@ -305,6 +305,10 @@
>>
>> executeSql( "update eventreport set collapsedatadimensions =
>> false where collapsedatadimensions is null" );
>> executeSql( "update eventchart set collapsedatadimensions =
>> false where collapsedatadimensions is null" );
>> +
>> + executeSql( "ALTER TABLE programindicator ALTER description TYPE
>> text" );
>> + executeSql( "ALTER TABLE programindicator ALTER expression TYPE
>> text" );
>> + executeSql( "ALTER TABLE programstage ALTER description TYPE
>> text" );
>>
>> updateProgramStageList();
>> updateProgramAttributeList();
>>
>> === modified file
>> 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml'
>> ---
>> dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml
>> 2015-03-29 20:22:47 +0000
>> +++
>> dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml
>> 2015-04-19 11:38:17 +0000
>> @@ -17,14 +17,14 @@
>>
>> <property name="shortName" />
>>
>> - <property name="description" />
>> + <property name="description" type="text" />
>>
>> <many-to-one name="program" class="org.hisp.dhis.program.Program"
>> column="programid" foreign-key="fk_programindicator_program"
>> not-null="true" />
>>
>> <property name="valueType" />
>>
>> - <property name="expression" />
>> + <property name="expression" type="text" />
>>
>> <property name="rootDate" />
>>
>>
>> === modified file
>> 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
>> ---
>> dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
>> 2015-03-31 16:25:10 +0000
>> +++
>> dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
>> 2015-04-19 11:38:17 +0000
>> @@ -18,7 +18,7 @@
>>
>> <property name="name" column="name" length="230" />
>>
>> - <property name="description" />
>> + <property name="description" type="text" />
>>
>> <property name="minDaysFromStart" column="mindaysfromstart"
>> not-null="true" />
>>
>> === modified file
>> 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js'
>> ---
>> dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
>> 2015-04-11 13:18:25 +0000
>> +++
>> dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
>> 2015-04-19 11:38:17 +0000
>> @@ -480,8 +480,7 @@
>> "rangelength" : [2,160]
>> },
>> "description" : {
>> - "required" : true,
>> - "rangelength" : [2,254]
>> + "required" : true
>> },
>> "reportDateDescription" : {
>> "required" : true,
>> @@ -548,8 +547,7 @@
>> "required" : true
>> },
>> "expression" : {
>> - "required" : true,
>> - "maxlength" : 254
>> + "required" : true
>> },
>> "valueType" : {
>> "required" : true
>>
>> === modified file
>> 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm'
>> ---
>> dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm
>> 2015-03-31 16:25:10 +0000
>> +++
>> dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm
>> 2015-04-19 11:38:17 +0000
>> @@ -112,7 +112,7 @@
>>
>> <tr>
>> <td><label for="description">$i18n.getString(
>> "description" ) <em title="$i18n.getString( 'required' )"
>> class="required">*</em></label></td>
>> - <td><input type="text" id="description"
>> name="description" /></td>
>> + <td><textarea id="description"
>> name="description"></textarea></td>
>> </tr>
>>
>> #if( $program.type == 1 )
>>
>> === modified file
>> 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm'
>> ---
>> dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm
>> 2015-03-31 16:25:10 +0000
>> +++
>> dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm
>> 2015-04-19 11:38:17 +0000
>> @@ -139,7 +139,7 @@
>>
>> <tr>
>> <td><label
>> for="description">$i18n.getString( "description" ) <em
>> title="$i18n.getString( 'required' )" class="required">*</em></label></td>
>> - <td><input type="text" id="description"
>> name="description" value="$encoder.htmlEncode( $programStage.description )"
>> /></td>
>> + <td><textarea id="description"
>> name="description">$!encoder.htmlEncode( $programStage.description
>> )</textarea></td>
>> </tr>
>>
>> #if($programStage.program.type==1)
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
>
> *******************************************
>
> Calle Hedberg
>
> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
>
> Tel/fax (home): +27-21-685-6472
>
> Cell: +27-82-853-5352
>
> Iridium SatPhone: +8816-315-19274
>
> Email: calle.hedberg@xxxxxxxxx
>
> Skype: calle_hedberg
>
> *******************************************
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help : https://help.launchpad.net/ListHelp
>
>
Follow ups
References