User Tools

Site Tools


tech2018:s4:get_activity

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tech2018:s4:get_activity [2018/06/07 12:33]
Gianluca Pelliccioli
tech2018:s4:get_activity [2018/06/07 13:19] (current)
Gianluca Pelliccioli
Line 1: Line 1:
-====== Get_activity =======+====== Get_activity controller =======
  
  
Line 6: Line 6:
 </code> </code>
  
 +
 +{{:tech2018:s4:get_activity_controller.png|}}
 +
 +
 +This is based on the controller:
 +
 +**/var/www/tests/giotto4.jamain.co/application/controllers/common/activities**
 +<code>
 +public function get_activity($id) {
 +                $activity = $this->activity->detail ( $id );
 +
 +                $company = $this->activity->get_company_name ();
 +                $statuses = $this->activity->get_transition_status ( $activity->type, NULL, $activity->id_process, $id );
 +                $customer = $this->activity->get_customer ( $activity->id_thread );
 +
 +                $activity->indirizzi_cliente = $this->activity->get_indirizzi_cliente ($customer->cliente_id );
 +                $activity->be = $this->activity->get_be ( $activity->id_thread );
 +                $this->load->model ( 'account' );
 +                $activity->account = $this->account->detail ( $customer->cliente_id );
 +                $activity->company = $company;
 +                $activity->customer = $customer;
 +                $activity->statuses = $statuses;
 +                $activity->contratti = $this->activity->get_contratti ( $activity->be->id );
 +                $activity->magic_variables = $this->activity->get_magic_fields ( $activity->form_id, $activity->type, $activity->id );
 +
 +                // CHANGE FORM DATA BASED ON FORM/ACTIVITY TYPE
 +                $this->load->library ( "get_activity_data" );
 +
 +                if ($id != null && isset ( $activity->type )) {
 +                        $activity_lib_data = $this->get_activity_data->get_data ( $id, $activity );
 +                        $activity = $activity_lib_data;
 +                }
 +
 +                $this->output->set_content_type ( 'application/json' )->set_output ( json_encode ( $activity ) );
 +        }
 +
 +</code>
  
 ##Verify Adharsh ##Verify Adharsh
Line 11: Line 48:
  
 <code> <code>
-$deadline = $activity->deadline != '' ? '<br><small>Da risolvere entro il '.date('d/m/Y H:i',datait2ts($activity->deadline)).'</small>' : null; +$reclamo = ""; 
-                                                                                        $reclamo = ""; +$pending = ""; 
-                                                                                        $pending = ""; +if($activity->reclamo == 't') $reclamo ="<i title='Reclamo' class='fa fa-bell-o red'></i> ";  
-                                                                                        if($activity->reclamo == 't') $reclamo ="<i title='Reclamo' class='fa fa-bell-o red'></i> "; +if($activity->thread_status == 'PENDING') $pending ="<i class='fa fa-hourglass-start'></i> "; 
-                                                                                        if($activity->thread_status == 'PENDING') $pending ="<i class='fa fa-hourglass-start'></i> "; +"<td>".$reclamo."".$pending."<a href='$link'>$activity->activity_title</a> <small style='font-size:70%'>($activity->role)</small> $thread <br><small>Creata da $activity->company_name<br>$activity->first_name $activity->last_name  il ".date('d-m-Y H:i',strtotime(str_replace('/', '-',$activity->created)))."</small><br><small>Assegnata a $activity->duty_company</small>$deadline</td>";
-                                                                                        echo "<td>".$reclamo."".$pending."<a href='$link'>$activity->activity_title</a> <small style='font-size:70%'>($activity->role)</small> $thread <br><small>Creata da $activity->company_name<br>$activity->first_name $activity->last_name  il ".date('d-m-Y H:i',strtotime(str_replace('/', '-',$activity->created)))."</small><br><small>Assegnata a $activity->duty_company</small>$deadline</td>"; +
-                                                                                        $statuses = activity::get_statuses($activity->type,$activity->status_value); +
-                                                                                        echo "<td><span class='label label-primary'>$activity->activity_status</span><br><small>".$statuses[0]->label."</small>" +
 </code> </code>
  
  
 [[tech2018:s4:dev_forms| Back to: dev forms]] [[tech2018:s4:dev_forms| Back to: dev forms]]
tech2018/s4/get_activity.1528374809.txt.gz · Last modified: 2018/06/07 12:33 by Gianluca Pelliccioli