CC-2524:Manage Media Folders:No error msg
- fixed - changed error msg text
This commit is contained in:
parent
4e28ee629a
commit
be7af45c66
2 changed files with 26 additions and 12 deletions
|
@ -126,13 +126,20 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$watched_dirs_form->populate(array('storageFolder' => $chosen));
|
$watched_dirs_form->populate(array('storageFolder' => $chosen));
|
||||||
$bool = $watched_dirs_form->verifyChosenFolder($element);
|
$bool = $watched_dirs_form->verifyChosenFolder($element);
|
||||||
|
|
||||||
|
// it has error checking in two part. It checks is_dir above, and
|
||||||
|
// check uniqueness in DB below. We should put is_dir checking into
|
||||||
|
// MusicDir class.
|
||||||
if ($bool === true) {
|
if ($bool === true) {
|
||||||
MusicDir::setStorDir($chosen);
|
$res = MusicDir::setStorDir($chosen);
|
||||||
$dirId = MusicDir::getStorDir()->getId();
|
if($res['code'] == 0){
|
||||||
$data = array();
|
$dirId = MusicDir::getStorDir()->getId();
|
||||||
$data["directory"] = $chosen;
|
$data = array();
|
||||||
$data["dir_id"] = $dirId;
|
$data["directory"] = $chosen;
|
||||||
RabbitMq::SendMessageToMediaMonitor("change_stor", $data);
|
$data["dir_id"] = $dirId;
|
||||||
|
RabbitMq::SendMessageToMediaMonitor("change_stor", $data);
|
||||||
|
}else{
|
||||||
|
$watched_dirs_form->getElement($element)->setErrors(array($res['error']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->subform = $watched_dirs_form->render();
|
$this->view->subform = $watched_dirs_form->render();
|
||||||
|
@ -146,11 +153,18 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$watched_dirs_form->populate(array('watchedFolder' => $chosen));
|
$watched_dirs_form->populate(array('watchedFolder' => $chosen));
|
||||||
$bool = $watched_dirs_form->verifyChosenFolder($element);
|
$bool = $watched_dirs_form->verifyChosenFolder($element);
|
||||||
|
|
||||||
|
// it has error checking in two part. It checks is_dir above, and
|
||||||
|
// check uniqueness in DB below. We should put is_dir checking into
|
||||||
|
// MusicDir class.
|
||||||
if ($bool === true) {
|
if ($bool === true) {
|
||||||
MusicDir::addWatchedDir($chosen);
|
$res = MusicDir::addWatchedDir($chosen);
|
||||||
$data = array();
|
if($res['code'] == 0){
|
||||||
$data["directory"] = $chosen;
|
$data = array();
|
||||||
RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
$data["directory"] = $chosen;
|
||||||
|
RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
||||||
|
}else{
|
||||||
|
$watched_dirs_form->getElement($element)->setErrors(array($res['error']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->subform = $watched_dirs_form->render();
|
$this->view->subform = $watched_dirs_form->render();
|
||||||
|
|
|
@ -54,7 +54,7 @@ class MusicDir {
|
||||||
}
|
}
|
||||||
catch(Exception $e){
|
catch(Exception $e){
|
||||||
//echo $e->getMessage();
|
//echo $e->getMessage();
|
||||||
return array("code"=>1, "error"=>"$p_path is already set as the current storage dir or the watched folders");
|
return array("code"=>1, "error"=>"$p_path is already set as the current storage dir or in the watched folders list");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ class MusicDir {
|
||||||
$dir->setDirectory($p_dir);
|
$dir->setDirectory($p_dir);
|
||||||
return array("code"=>0);
|
return array("code"=>0);
|
||||||
}else{
|
}else{
|
||||||
return array("code"=>1, "error"=>"$p_dir is already set as the current storage dir or the watched folders");
|
return array("code"=>1, "error"=>"$p_dir is already set as the current storage dir or in the watched folders list");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue