From 4160212e7bc366ac5967bf87b6517db3ebc3166c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 30 Jul 2012 15:47:18 +0200 Subject: [PATCH] Wrapping work title see BT#4703 --- main/inc/lib/display.lib.php | 3 +++ main/work/work.lib.php | 2 +- main/work/work.php | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 8c576fbf6c..d4ad8a276c 100644 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -914,6 +914,7 @@ class Display { } $json_encode = json_encode($obj); + if (!empty($data)) { //Converts the "data":"js_variable" to "data":js_variable othersiwe it will not work $json_encode = str_replace('"data":"'.$data_var.'"','"data":'.$data_var.'',$json_encode); @@ -921,6 +922,8 @@ class Display { //Fixing true/false js values that doesn't need the "" $json_encode = str_replace(':"true"',':true',$json_encode); + //wrap_cell is not a valid jqgrid attributes is a hack to wrap a text + $json_encode = str_replace('"wrap_cell":true','cellattr:function(rowId, tv, rawObject, cm, rdata) { return \'style ="white-space: normal;"\'}',$json_encode); $json_encode = str_replace(':"false"',':false',$json_encode); $json_encode = str_replace('"formatter":"action_formatter"','formatter:action_formatter',$json_encode); diff --git a/main/work/work.lib.php b/main/work/work.lib.php index ca12233146..7d630d0799 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -1655,7 +1655,7 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher $work['lastname'] = Display::div($work['lastname'], array('class' => $class)); $work['username'] = Display::div($work['username'], array('class' => $class)); - $work['title'] = Display::div(cut($work['title'], 20), array('class' => $class)); + $work['title'] = Display::div($work['title'], array('class' => $class)); //Type $work['type'] = build_document_icon_tag('file', $work['file']); diff --git a/main/work/work.php b/main/work/work.php index 907fe4a187..1320d6f3c5 100644 --- a/main/work/work.php +++ b/main/work/work.php @@ -1161,8 +1161,8 @@ switch ($action) { array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), - array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), - array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false'), + array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), @@ -1179,7 +1179,7 @@ switch ($action) { array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), - array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), //array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'),