View | Details | Raw Unified | Return to bug 5550 | Differences between
and this patch

Collapse All | Expand All

(-)a/classes/form/Form.inc.php (-1 / +1 lines)
 Lines 469-475   class Form { Link Here 
469
		// Display the language selector widget.
469
		// Display the language selector widget.
470
		$formLocale = $smarty->get_template_vars('formLocale');
470
		$formLocale = $smarty->get_template_vars('formLocale');
471
		$returner .= '<div id="languageSelector"><select size="1" name="formLocale" id="formLocale" onchange="changeFormAction(\'' . htmlentities($params['form'], ENT_COMPAT, LOCALE_ENCODING) . '\', \'' . htmlentities($params['url'], ENT_QUOTES, LOCALE_ENCODING) . '\')" class="selectMenu">';
471
		$returner .= '<div id="languageSelector"><select size="1" name="formLocale" id="formLocale" onchange="changeFormAction(\'' . htmlentities($params['form'], ENT_COMPAT, LOCALE_ENCODING) . '\', \'' . htmlentities($params['url'], ENT_QUOTES, LOCALE_ENCODING) . '\')" class="selectMenu">';
472
		foreach (Locale::getSupportedLocales() as $locale => $name) {
472
		foreach (Locale::getSupportedFormLocales() as $locale => $name) {
473
			$returner .= '<option ' . ($locale == $formLocale?'selected="selected" ':'') . 'value="' . htmlentities($locale, ENT_COMPAT, LOCALE_ENCODING) . '">' . htmlentities($name, ENT_COMPAT, LOCALE_ENCODING) . '</option>';
473
			$returner .= '<option ' . ($locale == $formLocale?'selected="selected" ':'') . 'value="' . htmlentities($locale, ENT_COMPAT, LOCALE_ENCODING) . '">' . htmlentities($name, ENT_COMPAT, LOCALE_ENCODING) . '</option>';
474
		}
474
		}
475
		$returner .= '</select></div>';
475
		$returner .= '</select></div>';
(-)a/classes/submission/PKPAuthor.inc.php (-4 / +13 lines)
 Lines 172-189   class PKPAuthor extends DataObject { Link Here 
172
172
173
	/**
173
	/**
174
	 * Get affiliation (position, institution, etc.).
174
	 * Get affiliation (position, institution, etc.).
175
	 * @param $locale string
175
	 * @return string
176
	 * @return string
176
	 */
177
	 */
177
	function getAffiliation() {
178
	function getAffiliation($locale) {
178
		return $this->getData('affiliation');
179
		return $this->getData('affiliation', $locale);
179
	}
180
	}
180
181
181
	/**
182
	/**
182
	 * Set affiliation.
183
	 * Set affiliation.
183
	 * @param $affiliation string
184
	 * @param $affiliation string
185
	 * @param $locale string
186
	 */
187
	function setAffiliation($affiliation, $locale) {
188
		return $this->setData('affiliation', $affiliation, $locale);
189
	}
190
191
	/**
192
	 * Get the localized affiliation for this author
184
	 */
193
	 */
185
	function setAffiliation($affiliation) {
194
	function getLocalizedAffiliation() {
186
		return $this->setData('affiliation', $affiliation);
195
		return $this->getLocalizedData('affiliation');
187
	}
196
	}
188
197
189
	/**
198
	/**
(-)a/classes/submission/PKPAuthorDAO.inc.php (-2 / +1 lines)
 Lines 93-99   class PKPAuthorDAO extends DAO { Link Here 
93
		$author->setFirstName($row['first_name']);
93
		$author->setFirstName($row['first_name']);
94
		$author->setMiddleName($row['middle_name']);
94
		$author->setMiddleName($row['middle_name']);
95
		$author->setLastName($row['last_name']);
95
		$author->setLastName($row['last_name']);
96
		$author->setAffiliation($row['affiliation']);
97
		$author->setCountry($row['country']);
96
		$author->setCountry($row['country']);
98
		$author->setEmail($row['email']);
97
		$author->setEmail($row['email']);
99
		$author->setUrl($row['url']);
98
		$author->setUrl($row['url']);
 Lines 121-127   class PKPAuthorDAO extends DAO { Link Here 
121
	 * @return array
120
	 * @return array
122
	 */
121
	 */
123
	function getLocaleFieldNames() {
122
	function getLocaleFieldNames() {
124
		return array('biography', 'competingInterests');
123
		return array('biography', 'competingInterests', 'affiliation');
125
	}
124
	}
126
125
127
	/**
126
	/**
(-)a/classes/user/PKPUser.inc.php (-7 / +16 lines)
 Lines 225-242   class PKPUser extends DataObject { Link Here 
225
225
226
	/**
226
	/**
227
	 * Get affiliation (position, institution, etc.).
227
	 * Get affiliation (position, institution, etc.).
228
	 * @param $locale string
228
	 * @return string
229
	 * @return string
229
	 */
230
	 */
230
	function getAffiliation() {
231
	function getAffiliation($locale) {
231
		return $this->getData('affiliation');
232
		return $this->getData('affiliation', $locale);
232
	}
233
	}
233
234
234
	/**
235
	/**
235
	 * Set affiliation.
236
	 * Set affiliation.
236
	 * @param $affiliation string
237
	 * @param $affiliation string
238
	 * @param $locale string
239
	 */
240
	function setAffiliation($affiliation, $locale) {
241
		return $this->setData('affiliation', $affiliation, $locale);
242
	}
243
244
	/**
245
	 * Get localized user affiliation.
237
	 */
246
	 */
238
	function setAffiliation($affiliation) {
247
	function getLocalizedAffiliation() {
239
		return $this->setData('affiliation', $affiliation);
248
		return $this->getLocalizedData('affiliation');
240
	}
249
	}
241
250
242
	/**
251
	/**
 Lines 580-588   class PKPUser extends DataObject { Link Here 
580
589
581
	function getContactSignature() {
590
	function getContactSignature() {
582
		$signature = $this->getFullName();
591
		$signature = $this->getFullName();
583
		if ($this->getAffiliation()) $signature .= "\n" . $this->getAffiliation();
592
		if ($a = $this->getLocalizedAffiliation()) $signature .= "\n" . $a;
584
		if ($this->getPhone()) $signature .= "\n" . Locale::translate('user.phone') . ' ' . $this->getPhone();
593
		if ($p = $this->getPhone()) $signature .= "\n" . Locale::translate('user.phone') . ' ' . $p;
585
		if ($this->getFax()) $signature .= "\n" . Locale::translate('user.fax') . ' ' . $this->getFax();
594
		if ($f = $this->getFax()) $signature .= "\n" . Locale::translate('user.fax') . ' ' . $f;
586
		$signature .= "\n" . $this->getEmail();
595
		$signature .= "\n" . $this->getEmail();
587
		return $signature;
596
		return $signature;
588
	}
597
	}
(-)a/classes/user/PKPUserDAO.inc.php (-7 / +3 lines)
 Lines 160-166   class PKPUserDAO extends DAO { Link Here 
160
		$user->setInitials($row['initials']);
160
		$user->setInitials($row['initials']);
161
		$user->setLastName($row['last_name']);
161
		$user->setLastName($row['last_name']);
162
		$user->setGender($row['gender']);
162
		$user->setGender($row['gender']);
163
		$user->setAffiliation($row['affiliation']);
164
		$user->setEmail($row['email']);
163
		$user->setEmail($row['email']);
165
		$user->setUrl($row['url']);
164
		$user->setUrl($row['url']);
166
		$user->setPhone($row['phone']);
165
		$user->setPhone($row['phone']);
 Lines 196-204   class PKPUserDAO extends DAO { Link Here 
196
		}
195
		}
197
		$this->update(
196
		$this->update(
198
			sprintf('INSERT INTO users
197
			sprintf('INSERT INTO users
199
				(username, password, salutation, first_name, middle_name, initials, last_name, gender, affiliation, email, url, phone, fax, mailing_address, country, locales, date_last_email, date_registered, date_validated, date_last_login, must_change_password, disabled, disabled_reason, auth_id, auth_str)
198
				(username, password, salutation, first_name, middle_name, initials, last_name, gender, email, url, phone, fax, mailing_address, country, locales, date_last_email, date_registered, date_validated, date_last_login, must_change_password, disabled, disabled_reason, auth_id, auth_str)
200
				VALUES
199
				VALUES
201
				(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, %s, %s, %s, %s, ?, ?, ?, ?, ?)',
200
				(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, %s, %s, %s, %s, ?, ?, ?, ?, ?)',
202
				$this->datetimeToDB($user->getDateLastEmail()), $this->datetimeToDB($user->getDateRegistered()), $this->datetimeToDB($user->getDateValidated()), $this->datetimeToDB($user->getDateLastLogin())),
201
				$this->datetimeToDB($user->getDateLastEmail()), $this->datetimeToDB($user->getDateRegistered()), $this->datetimeToDB($user->getDateValidated()), $this->datetimeToDB($user->getDateLastLogin())),
203
			array(
202
			array(
204
				$user->getUsername(),
203
				$user->getUsername(),
 Lines 209-215   class PKPUserDAO extends DAO { Link Here 
209
				$user->getInitials(),
208
				$user->getInitials(),
210
				$user->getLastName(),
209
				$user->getLastName(),
211
				$user->getGender(),
210
				$user->getGender(),
212
				$user->getAffiliation(),
213
				$user->getEmail(),
211
				$user->getEmail(),
214
				$user->getUrl(),
212
				$user->getUrl(),
215
				$user->getPhone(),
213
				$user->getPhone(),
 Lines 231-237   class PKPUserDAO extends DAO { Link Here 
231
	}
229
	}
232
230
233
	function getLocaleFieldNames() {
231
	function getLocaleFieldNames() {
234
		return array('biography', 'signature', 'interests', 'gossip');
232
		return array('biography', 'signature', 'interests', 'gossip', 'affiliation');
235
	}
233
	}
236
234
237
	function updateLocaleFields(&$user) {
235
	function updateLocaleFields(&$user) {
 Lines 261-267   class PKPUserDAO extends DAO { Link Here 
261
					initials = ?,
259
					initials = ?,
262
					last_name = ?,
260
					last_name = ?,
263
					gender = ?,
261
					gender = ?,
264
					affiliation = ?,
265
					email = ?,
262
					email = ?,
266
					url = ?,
263
					url = ?,
267
					phone = ?,
264
					phone = ?,
 Lines 288-294   class PKPUserDAO extends DAO { Link Here 
288
				$user->getInitials(),
285
				$user->getInitials(),
289
				$user->getLastName(),
286
				$user->getLastName(),
290
				$user->getGender(),
287
				$user->getGender(),
291
				$user->getAffiliation(),
292
				$user->getEmail(),
288
				$user->getEmail(),
293
				$user->getUrl(),
289
				$user->getUrl(),
294
				$user->getPhone(),
290
				$user->getPhone(),

Return to bug 5550