Example #1
0
 /**
  * testProjectClose
  *
  * @param	Project	$localobject	Project
  * @return	int
  *
  * @depends testProjectValid
  * The depends says test is run only if previous is ok
  */
 public function testProjectOther($localobject)
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     $result = $localobject->setClose($user);
     print __METHOD__ . " id=" . $localobject->id . " result=" . $result . "\n";
     $this->assertLessThan($result, 0);
     return $localobject->id;
 }
Example #2
0
{
    $project = new Project($db);
    $project->fetch(GETPOST("id"));

    $result = $project->setValid($user);
    if ($result <= 0)
    {
        $mesg='<div class="error">'.$project->error.'</div>';
    }
}

if (GETPOST('action') == 'confirm_close' && GETPOST('confirm') == 'yes')
{
    $project = new Project($db);
    $project->fetch(GETPOST("id"));
    $result = $project->setClose($user);
    if ($result <= 0)
    {
        $mesg='<div class="error">'.$project->error.'</div>';
    }
}

if (GETPOST('action') == 'confirm_reopen' && GETPOST('confirm') == 'yes')
{
    $project = new Project($db);
    $project->fetch(GETPOST("id"));
    $result = $project->setValid($user);
    if ($result <= 0)
    {
        $mesg='<div class="error">'.$project->error.'</div>';
    }