[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gforge-commits] gforge/common/tracker ArtifactExtraField.class, 1.1, 1
From: |
tperdue |
Subject: |
[Gforge-commits] gforge/common/tracker ArtifactExtraField.class, 1.1, 1.2 |
Date: |
Fri, 08 Oct 2004 12:47:06 -0500 |
Update of /cvsroot/gforge/gforge/common/tracker
In directory db.perdue.net:/home/tperdue/share/dev.gforge.org/common/tracker
Modified Files:
ArtifactExtraField.class
Log Message:
adding the rest of the multiple renderer code for unlimited fields in tracker
Index: ArtifactExtraField.class
===================================================================
RCS file: /cvsroot/gforge/gforge/common/tracker/ArtifactExtraField.class,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ArtifactExtraField.class 7 Oct 2004 19:30:49 -0000 1.1
+++ ArtifactExtraField.class 8 Oct 2004 17:47:03 -0000 1.2
@@ -88,10 +88,13 @@
* a tracker. This function is only used to create rows for boxes
* configured by the admin.
*
- * @param string Name of the box.
+ * @param string Name of the extra field.
+ * @param int The type of field - radio, select, text,
textarea
+ * @param int Attribute1 - for text (size) and textarea (rows)
+ * @param int Attribute2 - for text (maxlength) and textarea
(cols)
* @return true on success / false on failure.
*/
- function create($name) {
+ function create($name,$field_type,$attribute1,$attribute2) {
global $Language;
//
@@ -105,8 +108,9 @@
$this->setPermissionDeniedError();
return false;
}
- $sql="INSERT INTO artifact_extra_field_list
(group_artifact_id,field_name)
- VALUES
('".$this->ArtifactType->getID()."','".htmlspecialchars($name)."')";
+ $sql="INSERT INTO artifact_extra_field_list
(group_artifact_id,field_name,field_type,attribute1,attribute2)
+ VALUES
('".$this->ArtifactType->getID()."','".htmlspecialchars($name)."',
+ '$field_type','$attribute1','$attribute2')";
$result=db_query($sql);
@@ -117,14 +121,14 @@
$this->setError(db_error());
return false;
}
- //
- // Now set up our internal data structures
- //
- if (!$this->fetchData($id)) {
- return false;
- }
-
+ //
+ // Now set up our internal data structures
+ //
+ if (!$this->fetchData($id)) {
+ return false;
+ }
}
+
/**
* fetchData - re-fetch the data for this ArtifactExtraField from
the database.
*
@@ -172,21 +176,59 @@
}
/**
+ * getAttribute1 - get the attribute1 field.
+ *
+ * @return int The first attribute.
+ */
+ function getAttribute1() {
+ return $this->data_array['attribute1'];
+ }
+
+ /**
+ * getAttribute2 - get the attribute2 field.
+ *
+ * @return int The second attribute.
+ */
+ function getAttribute2() {
+ return $this->data_array['attribute2'];
+ }
+
+ /**
+ * getAvailableTypes - the types of text fields and their names
available.
+ *
+ * @return array types.
+ */
+ function getAvailableTypes() {
+ global $Language;
+ return array(
+
1=>$Language->getText('tracker_admin_build_boxes','box_type_select'),
+
3=>$Language->getText('tracker_admin_build_boxes','box_type_radio'),
+
4=>$Language->getText('tracker_admin_build_boxes','box_type_text'),
+
6=>$Language->getText('tracker_admin_build_boxes','box_type_textarea')
+ );
+ }
+
+ /**
* update - update a row in the table used to store box names
* for a tracker. This function is only to update rowsf
* for boxes configured by
* the admin.
*
- * @param string Name of the box.
+ * @param string Name of the field.
+ * @param int Attribute1 - for text (size) and textarea (rows)
+ * @param int Attribute2 - for text (maxlength) and textarea
(cols)
* @return boolean success.
*/
- function update($name) {
+ function update($name,$attribute1,$attribute2) {
if (!$this->ArtifactType->userIsAdmin()) {
$this->setPermissionDeniedError();
return false;
}
$sql="UPDATE artifact_extra_field_list
- SET field_name='".htmlspecialchars($name)."'
+ SET
+ field_name='".htmlspecialchars($name)."',
+ attribute1='$attribute1',
+ attribute2='$attribute2'
WHERE extra_field_id='". $this->getID() ."'
AND
group_artifact_id='".$this->ArtifactType->getID()."'";
$result=db_query($sql);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gforge-commits] gforge/common/tracker ArtifactExtraField.class, 1.1, 1.2,
tperdue <=
- Prev by Date:
[Gforge-commits] gforge/www/tracker/admin form-addextrafield.php, 1.1, 1.2 form-updateextrafield.php, 1.1, 1.2 updates.php, 1.1, 1.2
- Next by Date:
[Gforge-commits] gforge/www/include/languages Base.tab,1.185,1.186
- Previous by thread:
[Gforge-commits] gforge/www/tracker/admin form-addextrafield.php, 1.1, 1.2 form-updateextrafield.php, 1.1, 1.2 updates.php, 1.1, 1.2
- Next by thread:
[Gforge-commits] gforge/www/include/languages Base.tab,1.185,1.186
- Index(es):