[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7097] Frontend: more on drawings/documents
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7097] Frontend: more on drawings/documents |
Date: |
Wed, 09 Mar 2011 08:10:13 +0000 |
Revision: 7097
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7097
Author: sigurdne
Date: 2011-03-09 08:10:13 +0000 (Wed, 09 Mar 2011)
Log Message:
-----------
Frontend: more on drawings/documents
Modified Paths:
--------------
trunk/frontend/inc/class.uidrawings.inc.php
trunk/frontend/inc/hook_config.inc.php
trunk/frontend/js/yahoo/drawing.list.js
trunk/frontend/setup/phpgw_no.lang
trunk/frontend/templates/base/config.tpl
Modified: trunk/frontend/inc/class.uidrawings.inc.php
===================================================================
--- trunk/frontend/inc/class.uidrawings.inc.php 2011-03-09 08:09:29 UTC (rev
7096)
+++ trunk/frontend/inc/class.uidrawings.inc.php 2011-03-09 08:10:13 UTC (rev
7097)
@@ -50,19 +50,30 @@
public function index()
{
- $doc_type = 17;
+ $config = CreateObject('phpgwapi.config','frontend');
+ $config->read();
+ $doc_types =
isset($config->config_data['document_frontend_cat']) &&
$config->config_data['document_frontend_cat'] ?
$config->config_data['document_frontend_cat'] : array();
+
$allrows = true;
$sodocument = CreateObject('property.sodocument');
$document_list = array();
+ $total_records = 0;
if( $this->location_code )
{
- $document_list =
$sodocument->read_at_location(array('start' => $this->start,'query' =>
$this->query,'sort' => $this->sort,'order' => $this->order,
- 'filter' =>
$this->filter,'location_code' => $this->location_code,'doc_type' => $doc_type,
'allrows' => $allrows));
+ foreach ($doc_types as $doc_type)
+ {
+ if($doc_type)
+ {
+ $document_list =
array_merge($document_list, $sodocument->read_at_location(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
+ 'filter' =>
$this->filter,'location_code' => $this->location_code,'doc_type' => $doc_type,
'allrows' => $allrows)));
+ }
+
+ $total_records = $total_records +
$sodocument->total_records;
+ }
}
+
- $total_records = $sodocument->total_records;
-
//----------------------------------------------datatable settings--------
$content = array();
@@ -93,10 +104,10 @@
$myColumnDefs[0] = array
(
'name' => "0",
- 'values' => json_encode(array(
array('key' => 'document_name','label'=>lang('name'),'sortable'=>true,'hidden'
=> true,'resizeable'=>true),
-
array('key' =>
'document_id','label'=>lang('name'),'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
-
array('key' =>
'title','label'=>lang('title'),'sortable'=>false,'resizeable'=>true),
-
array('key' =>
'doc_type','label'=>lang('type'),'sortable'=>true,'resizeable'=>true),
+ 'values' => json_encode(array(
array('key' =>
'document_name','label'=>lang('filename'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
+
array('key' =>
'document_id','label'=>lang('filename'),'sortable'=>false,'hidden' => true),
+
array('key' =>
'title','label'=>lang('name'),'sortable'=>true,'resizeable'=>true),
+
array('key' =>
'doc_type','label'=>'Type','sortable'=>true,'resizeable'=>true),
array('key' =>
'document_date','label'=>lang('date'),'sortable'=>true,'resizeable'=>true)
))
);
Modified: trunk/frontend/inc/hook_config.inc.php
===================================================================
--- trunk/frontend/inc/hook_config.inc.php 2011-03-09 08:09:29 UTC (rev
7096)
+++ trunk/frontend/inc/hook_config.inc.php 2011-03-09 08:10:13 UTC (rev
7097)
@@ -191,3 +191,30 @@
}
return $out;
}
+
+ /**
+ * Get HTML checkbox with categories that are candidates for frontend
documents cat
+ *
+ * @param $config
+ * @return string options for selectbox
+ */
+ function document_frontend_cat($config)
+ {
+ $cats = CreateObject('phpgwapi.categories', -1, 'property',
'.document');
+ $cats->supress_info = true;
+ $values = $cats->return_sorted_array(0, false, '', '', '',
$globals = true, '', $use_acl = false);
+ $tts_frontend_cat_selected =
isset($config['document_frontend_cat']) ? $config['document_frontend_cat'] :
array();
+ $out = '';
+ foreach ( $values as $entry)
+ {
+ $checked = '';
+ if ( in_array($entry['id'], $tts_frontend_cat_selected))
+ {
+ $checked = ' checked';
+ }
+ $out .= <<<HTML
+ <tr><td><input type="checkbox"
name="newsettings[document_frontend_cat][]" value="{$entry['id']}"
{$checked}><label>{$entry['name']}</label></td></tr>
+HTML;
+ }
+ return $out;
+ }
Modified: trunk/frontend/js/yahoo/drawing.list.js
===================================================================
--- trunk/frontend/js/yahoo/drawing.list.js 2011-03-09 08:09:29 UTC (rev
7096)
+++ trunk/frontend/js/yahoo/drawing.list.js 2011-03-09 08:10:13 UTC (rev
7097)
@@ -3,8 +3,8 @@
/********************************************************************************/
YAHOO.widget.DataTable.formatLink = function(elCell, oRecord, oColumn,
oData)
{
-// console.log(oRecord._oData.document_name);
- elCell.innerHTML = "<a
href="+datatable[0][0]["edit_action"]+"&id="+oData+">" +
oRecord._oData.document_name + "</a>";
+// console.log(oRecord._oData.document_id);
+ elCell.innerHTML = "<a
href="+datatable[0][0]["edit_action"]+"&id="+oRecord._oData.document_id+">" +
oData + "</a>";
};
Modified: trunk/frontend/setup/phpgw_no.lang
===================================================================
--- trunk/frontend/setup/phpgw_no.lang 2011-03-09 08:09:29 UTC (rev 7096)
+++ trunk/frontend/setup/phpgw_no.lang 2011-03-09 08:10:13 UTC (rev 7097)
@@ -129,3 +129,4 @@
remove_delegate_error frontend no Fjerning av delegaten var
mislykket
message_empty frontend no Meldingen kan ikke være tom
upload_userdoc frontend no Last opp brukerveiledning
+filename frontend no Filnavn
Modified: trunk/frontend/templates/base/config.tpl
===================================================================
--- trunk/frontend/templates/base/config.tpl 2011-03-09 08:09:29 UTC (rev
7096)
+++ trunk/frontend/templates/base/config.tpl 2011-03-09 08:10:13 UTC (rev
7097)
@@ -72,6 +72,16 @@
</td>
</tr>
<tr class="row_off">
+ <td>{lang_document_frontend_category}:</td>
+ <td>
+ <!--to be able to blank the setting - need an empty value-->
+ <input type = 'hidden'
name="newsettings[document_frontend_cat][]" value="">
+ <table>
+{hook_document_frontend_cat}
+ </table>
+ </td>
+ </tr>
+ <tr class="row_off">
<td>{lang_delegate_limit}:</td>
<td><input name="newsettings[delegate_limit]"
value="{value_delegate_limit}"></td>
</tr>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7097] Frontend: more on drawings/documents,
Sigurd Nes <=