Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ras2000

Pages: [1]
1
How To's / Multiple task selection extended
« on: May 07, 2009, 08:34:29 am »
I am trying to add a few possibilities in the task view. So far I've managed to make it possible to 'un'complete selected tasks by

In public/assets/javascript/og/tasks/taskstoptoolbar.js add
      uncomplete: new Ext.Action({
         text: lang('do uncomplete'),
            tooltip: lang('uncomplete selected tasks'),
            iconCls: 'ico-uncomplete',
         disabled: true,
         handler: function() {
            ogTasks.executeAction('uncomplete');
         },
         scope: this
      })
around line 130
and add
   this.add(actions.uncomplete);
around line 390
and change the function updateCheckedStatus() to
   updateCheckedStatus : function(){
      var checked = false;
      var allIncomplete = true;
      var allComplete = true;
      for (var i = 0; i < ogTasks.Tasks.length; i++)
         if (ogTasks.Tasks.isChecked){
            checked = true;
            if (ogTasks.Tasks.status == 1)
               allIncomplete = false;
            if (ogTasks.Tasks.status == 0)
               allComplete = false;
         }
      
      if (!checked){
         this.actions.del.disable();
         this.actions.complete.disable();
         this.actions.tag.disable();
      } else {
         this.actions.del.enable();
         this.actions.tag.enable();
         if (allIncomplete)
            this.actions.complete.enable();
         else
            this.actions.complete.disable();
         if (allComplete)
            this.actions.uncomplete.enable();
         else
            this.actions.uncomplete.disable();
            
      }
in TaskController.class.php, add the function
   function uncomplete_task() {
      ajx_current("empty");
      $task = ProjectTasks::findById(get_id());
      if(!($task instanceof ProjectTask)) {
         flash_error(lang('task dnx'));
         return;
      } // if

      if(!$task->canChangeStatus(logged_user())) {
         flash_error(lang('no access permissions'));
         return;
      } // if

      try {
         DB::beginWork();
         $task->uncompleteTask();
         DB::commit();
         flash_success(lang('success uncomplete task'));
         
         $redirect_to = array_var($_GET, 'redirect_to', false);
         if (array_var($_GET, 'quick', false)) {
            ajx_current("empty");
            ajx_extra_data(array("task" => $task->getArrayInfo()));
         } else {
            ajx_current("reload");
         }
      } catch(Exception $e) {
         DB::rollback();
         flash_error($e->getMessage());
      } // try
   } // uncomplete_task
ie around line 1130
and in ProjectTask.class.php add the function
   function uncompleteTask() {
      $this->setCompletedOn(null);
      $this->setCompletedById(0);
      $this->save();
      ApplicationLogs::createLog($this, $this->getWorkspaces(), ApplicationLogs::ACTION_OPEN);
   } // uncompleteTask
ie around line 433

2
How To's / adding fields in table, applying in controller
« on: April 21, 2009, 09:38:42 am »
Hello all
I was looking at
http://forums.opengoo.org/index.php?topic=1494.0
and thought I'd give it a try

I added a column to og_billing_categories called default_currency

I added the fields in add.php and index.php

I added the functions inBaseBillingCategory.class.php and the parameter in BillingController.class.php.

But the field is not updated in the table, and if I enter the currency manually, it does not appear on the pages.

Anyone know what I'm doing wrong?

I added the functions
    function getDefaultCurrency() {
      return $this->getColumnValue('default_currency');
    } // getDefaultCurrency()
    function setDefaultCurrency($value) {
      return $this->setColumnValue('default_currency', $value);
    } // setDefaultCurrency)
in BaseBillingCategory.class.php

I added this in BillingController.class.php, wherever relevant
            'default_currency' => '',

And changed the line where the $ was hardcoded in billing/index.php to
    <td style="text-align: center;padding:5px;padding-left:10px;padding-right:10px;"><?php echo clean($billing->getDefaultCurrency()) ?></td>
    <td style="text-align: center;padding:5px;padding-left:10px;padding-right:10px;"><?php echo clean($billing->getDefaultValue()) ?></td>

What else needs to be done for it to take effect?

3
How To's / Amount of tasks shown in view
« on: April 20, 2009, 06:15:06 am »
I would like to change the amount of tasks listed in the task view from 8, but I can't find out where that limit is set.

I would have thought that the files would be in the application/views/task folder, but that doesn't seem to be the case.

4
How To's / Starting the week with a monday
« on: April 15, 2009, 07:27:04 am »
Working in Denmark, we prefer seeing the calendar starting the week with monday.

Looking through the code in cal_gatekeeper.php, I can see that it seeks an option called start_monday in the db through a function called cal_query_getoptions().

This function is blocked out however, so I can't see where to set this property.

Does anyone know where I can set this value?

5
How To's / Multiple users can edit the same document at the same time?
« on: March 27, 2009, 09:10:57 am »
Hello, just getting started with this system, so I'm not sure this is the right board for my question.

In the documents view, if the document is .html or .slim, two users can edit the same document at the same time.

Is there any way to lock a document being edited? I know the right way is to check the document out, but not all users will do so.

We are a few in the company who enjoy getting our hands dirty with PHP, so very technical answers would also be useful.

Thanx
Ras

Pages: [1]