=== modified file 'dhis-2/dhis-web/dhis-web-sms/pom.xml'
--- dhis-2/dhis-web/dhis-web-sms/pom.xml 2013-03-22 13:47:40 +0000
+++ dhis-2/dhis-web/dhis-web-sms/pom.xml 2013-05-24 10:15:02 +0000
@@ -21,8 +21,8 @@
javax.servlet
servlet-api
-
-
+
+
@@ -50,7 +50,7 @@
org.hisp.dhis
dhis-support-test
-
+
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/MenuAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/MenuAction.java 2012-12-04 23:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/MenuAction.java 2013-05-24 10:15:02 +0000
@@ -1,5 +1,7 @@
+package org.hisp.dhis.sms.action;
+
/*
- * Copyright (c) 2004-2012, University of Oslo
+ * Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,8 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.hisp.dhis.sms.action;
-
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.i18n.I18nFormat;
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/NoAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/NoAction.java 2012-06-18 06:14:19 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/NoAction.java 2013-05-24 10:15:02 +0000
@@ -1,5 +1,7 @@
+package org.hisp.dhis.sms.action;
+
/*
- * Copyright (c) 2004-2012, University of Oslo
+ * Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,8 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.hisp.dhis.sms.action;
-
import com.opensymphony.xwork2.Action;
public class NoAction
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInput.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInput.java 2013-04-03 10:50:16 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInput.java 2013-05-24 10:15:02 +0000
@@ -1,20 +1,44 @@
package org.hisp.dhis.sms.input;
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.sms.incoming.IncomingSms;
import org.hisp.dhis.sms.incoming.IncomingSmsService;
import org.hisp.dhis.sms.incoming.SmsMessageEncoding;
import org.hisp.dhis.sms.incoming.SmsMessageStatus;
-import com.opensymphony.xwork2.Action;
-
/**
- *
* @author Christian and Magnus
*/
public class SMSInput
implements Action
{
-
private String sender, phone, number, msisdn;
private String message, text, content;
@@ -28,7 +52,7 @@
IncomingSms sms = new IncomingSms();
// setter for sms's originator
- if ( sender != null)
+ if ( sender != null )
{
sms.setOriginator( sender );
}
@@ -46,7 +70,7 @@
}
// setter for sms's text
- if ( message != null)
+ if ( message != null )
{
sms.setText( message );
}
@@ -58,14 +82,14 @@
{
sms.setText( content );
}
-
+
// check whether 2 necessary attributes are null
if ( sms.getOriginator() == null || sms.getText() == null )
{
setNullToAll();
return ERROR;
}
-
+
java.util.Date rec = new java.util.Date();
sms.setReceivedDate( rec );
sms.setSentDate( rec );
@@ -88,7 +112,7 @@
number = null;
message = null;
text = null;
- content =null;
+ content = null;
}
public void setSender( String sender )
@@ -100,7 +124,7 @@
{
this.phone = phone;
}
-
+
public void setNumber( String number )
{
this.number = number;
@@ -115,12 +139,12 @@
{
this.message = message;
}
-
+
public void setText( String text )
{
this.text = text;
}
-
+
public void setContent( String content )
{
this.content = content;
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java 2013-05-20 09:32:19 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java 2013-05-24 10:15:02 +0000
@@ -1,7 +1,7 @@
package org.hisp.dhis.sms.outcoming;
/*
- * Copyright (c) 2004-2012, University of Oslo
+ * Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,14 +27,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
+import com.opensymphony.xwork2.Action;
import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
import org.codehaus.jackson.annotate.JsonMethod;
-import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
@@ -44,7 +40,6 @@
import org.hisp.dhis.oust.manager.SelectionTreeManager;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
-
import org.hisp.dhis.sms.outbound.OutboundSmsTransportService;
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.user.User;
@@ -52,7 +47,10 @@
import org.hisp.dhis.user.UserGroupService;
import org.springframework.beans.factory.annotation.Autowired;
-import com.opensymphony.xwork2.Action;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
/**
* @author Dang Duy Hieu
@@ -86,7 +84,7 @@
{
this.messageSender = messageSender;
}
-
+
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
@@ -155,7 +153,7 @@
// Action Implementation
// -------------------------------------------------------------------------
- @SuppressWarnings( "unchecked" )
+ @SuppressWarnings("unchecked")
public String execute()
{
gatewayId = transportService.getDefaultGateway();
@@ -175,9 +173,9 @@
}
User currentUser = currentUserService.getCurrentUser();
-
+
Set recipientsList = new HashSet();
-
+
if ( sendTarget != null && sendTarget.equals( "phone" ) )
{
try
@@ -185,8 +183,8 @@
ObjectMapper mapper = new ObjectMapper().setVisibility( JsonMethod.FIELD, Visibility.ANY );
mapper.configure( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false );
recipients = mapper.readValue( recipients.iterator().next(), Set.class );
-
- for( String each: recipients )
+
+ for ( String each : recipients )
{
User user = new User();
user.setPhoneNumber( each );
@@ -207,7 +205,7 @@
}
//message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, true, recipients, gatewayId );
message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, recipientsList, false );
-
+
}
else if ( sendTarget.equals( "userGroup" ) )
{
@@ -277,7 +275,7 @@
}
//message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, true, recipients, gatewayId );
- message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, recipientsList, false);
+ message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, recipientsList, false );
}
else
{
@@ -325,7 +323,7 @@
}
//message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, true, phones, gatewayId );
- message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, recipientsList, false);
+ message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, recipientsList, false );
}
if ( message != null && !message.equals( "success" ) )
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java 2013-03-12 05:40:42 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java 2013-05-24 10:15:02 +0000
@@ -27,12 +27,6 @@
package org.hisp.dhis.sms.outcoming;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.paging.ActionPagingSupport;
@@ -43,6 +37,12 @@
import org.hisp.dhis.program.ProgramService;
import org.springframework.beans.factory.annotation.Autowired;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
/**
* @author Abyot Asalefew Gizaw
* @version $Id SearchPatientAction.java copyright from SearchPatientAction in case-entry$
@@ -153,7 +153,7 @@
total = patientService.countSearchPatients( searchTexts, organisationUnit );
this.paging = createPaging( total );
- patients = patientService.searchPatients( searchTexts, organisationUnit, paging.getStartPos(), paging
+ patients = patientService.searchPatients( searchTexts, organisationUnit, null, paging.getStartPos(), paging
.getPageSize() );
if ( !searchBySelectedOrgunit )
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ShowSendSMSFormAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ShowSendSMSFormAction.java 2013-03-12 05:40:42 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ShowSendSMSFormAction.java 2013-05-24 10:15:02 +0000
@@ -1,7 +1,7 @@
package org.hisp.dhis.sms.outcoming;
/*
- * Copyright (c) 2004-2012, University of Oslo
+ * Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-sms/src/main/resources/META-INF/dhis/beans.xml 2013-05-20 09:32:19 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/resources/META-INF/dhis/beans.xml 2013-05-24 10:15:02 +0000
@@ -1,26 +1,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml 2013-04-17 09:03:38 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml 2013-05-24 10:15:02 +0000
@@ -1,86 +1,70 @@
-
-
-
-
-
-
-
-
-
- showSendingSMSForm.action
-
-
-
-
-
- /dhis-web-sms/main.vm
-
- /dhis-web-sms/testsms.vm
-
-
-
-
- /dhis-web-sms/smssuccess.vm
-
-
- /dhis-web-sms/smserror.vm
-
-
-
-
-
-
- /main.vm
- /dhis-web-sms/sendSMSPage.vm
- /dhis-web-sms/menu.vm
-
- ../dhis-web-commons/oust/oust.js,
- ../dhis-web-sms/javascript/sendSMS.js
-
- ../dhis-web-sms/css/patient.css
- F_MOBILE_SENDSMS
-
-
-
- /main.vm
-
- /dhis-web-sms/sendBeneficiarySMSPage.vm
-
- /dhis-web-sms/menuWithTree.vm
- ../dhis-web-commons/ouwt/ouwt.js
- ../dhis-web-sms/css/patient.css
- F_MOBILE_SENDSMS,F_PATIENT_SEARCH
-
-
-
- /content.vm
-
- /dhis-web-sms/patientRegistrationList.vm
-
- F_PATIENT_SEARCH
-
-
-
-
- ../dhis-web-commons/ajax/jsonResponseSuccess.vm
-
-
- ../dhis-web-commons/ajax/jsonResponseError.vm
-
- plainTextError
- F_MOBILE_SENDSMS
-
-
- /dhis-web-commons/ajax/jsonResponseSuccess.vm
-
- F_SEARCH_PATIENT_IN_ALL_FACILITIES
-
-
-
-
+
+
+
+
+
+
+
+
+ showSendingSMSForm.action
+
+
+
+ /dhis-web-sms/main.vm
+ /dhis-web-sms/testsms.vm
+
+
+
+ /dhis-web-sms/smssuccess.vm
+ /dhis-web-sms/smserror.vm
+
+
+
+
+
+ /main.vm
+ /dhis-web-sms/sendSMSPage.vm
+ /dhis-web-sms/menu.vm
+
+ ../dhis-web-commons/oust/oust.js,
+ ../dhis-web-sms/javascript/sendSMS.js
+
+ ../dhis-web-sms/css/patient.css
+ F_MOBILE_SENDSMS
+
+
+
+ /main.vm
+ /dhis-web-sms/sendBeneficiarySMSPage.vm
+ /dhis-web-sms/menuWithTree.vm
+ ../dhis-web-commons/ouwt/ouwt.js
+ ../dhis-web-sms/css/patient.css
+ F_MOBILE_SENDSMS,F_PATIENT_SEARCH
+
+
+
+ /content.vm
+ /dhis-web-sms/patientRegistrationList.vm
+ F_PATIENT_SEARCH
+
+
+
+ ../dhis-web-commons/ajax/jsonResponseSuccess.vm
+ ../dhis-web-commons/ajax/jsonResponseError.vm
+ plainTextError
+ F_MOBILE_SENDSMS
+
+
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm
+
+ F_SEARCH_PATIENT_IN_ALL_FACILITIES
+
+
+
+